Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Local copy writes the clipboard natively and via OSC 52 at once, racing the terminal (macOS)

未关闭 适合新手
#59,052 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
78/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
typescript
领域
cli

调研方向

找到使用目标“all-available”的 TUI 剪贴板写入操作,并阅读剪贴板服务如何为本地和远程会话处理“best-available”。更改 TUI 的复制行为,避免同时进行本地写入,同时保留 SSH 使用的 OSC 52。完成标准是:重复进行本地复制不再触发 Alacritty 的警告,远程复制仍使用 OSC 52。

由索引模型根据 Issue 内容生成。

描述

Description

Since upgrading from 1.18.30 to 2.1.4, copying text in the TUI often makes Alacritty show:

[WARN] Unable to store text in clipboard: NSPasteboard#writeObjects: returned false

The TUI's clipboard write uses destination: "all-available", which starts the in-process host write and emits OSC 52 at the same moment. Locally, the terminal then writes the same pasteboard concurrently, and one of the two writes is rejected. The text still lands, but the terminal shows the warning.

1.18.30 also did both, but OSC 52 went first and the native write was a spawned osascript, so the two never overlapped.

The clipboard service already has "best-available" (host first, OSC 52 only if the host write fails or the session is remote). Using that for TUI copies would keep OSC 52 for SSH, where it's needed, and avoid the double write locally.

Plugins

@tarquinen/opencode-dcp, plus two local plugins (none touch the clipboard)

OpenCode version

2.1.4 (Homebrew)

Steps to reproduce
  1. Run opencode in Alacritty on macOS (default terminal.osc52 = "OnlyCopy"), not over SSH.
  2. Select text to copy, a few times.
  3. Alacritty intermittently shows the warning above.
Operating System

macOS 27.0.1

Terminal

Alacritty 0.17.0

主要语言
TypeScript
星标
221k
派生
29.6k
平均合并
5 小时 22 分钟
30 天内合并 PR
531

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

anomalyco/opencode 的其他 Issue

查看 anomalyco/opencode 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。