You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Clipboard copy broken on macOS + WezTerm: appends instead of replacing, plays error sound #8174
Copy/paste from OpenCode's TUI is broken in recent versions. The TUI selection feature (select text with mouse, release to copy) no longer works reliably.
Symptoms
Appending instead of replacing clipboard: When selecting text, the clipboard content is appended to rather than replaced. Selecting two different lines results in both being concatenated in the clipboard.
macOS "pew" error sound: The system alert sound plays when releasing the mouse selection, indicating a failed or rejected operation.
Multiline selection is especially broken: Single-line selections sometimes work, but multiline selections consistently exhibit the append behavior.
Cmd+C doesn't help: Holding the selection and pressing Cmd+C simultaneously still produces the same broken behavior.
Expected Behavior
Selecting text and releasing the mouse should copy ONLY the selected text to clipboard (replacing any previous content)
No system error sound should play
Cmd+C while selecting should work as a fallback
Workaround
Holding Shift while selecting bypasses OpenCode's TUI mouse handling and uses WezTerm's native selection. This works reliably but loses the OpenCode theme styling on the selection.
Analysis
This appears to be an issue with OpenCode's OSC 52 clipboard escape sequence handling. The append behavior and error sound suggest:
Malformed or duplicate OSC 52 sequences being sent
Possible conflict between OpenCode's clipboard writes and the terminal's handling
Reproduction Steps
Run opencode in WezTerm on macOS
Start a conversation so there's text to select
Select a single line of text with the mouse and release
Note: sometimes works, sometimes plays "pew" sound
Select a different line of text
Paste - observe BOTH selections are in clipboard (appended)
Additional Context
WezTerm config has no custom mouse_bindings (using defaults)
OpenCode config is standard, no special TUI settings
Issue started in recent OpenCode versions (not a fresh install issue)
Copy To Clipboard is not working #4283: Copy To Clipboard is not working - General clipboard copy failures showing "copied to clipboard" but paste doesn't work
These issues suggest a broader clipboard handling problem affecting multiple platforms (macOS, Windows, Linux) and terminals (WezTerm, Windows Terminal, MobaXterm). Your specific OSC 52 sequence issue on macOS + WezTerm might be the root cause affecting all platforms.
Feel free to ignore if your issue has specific differences from these.
Activity
github-actions commentedon Jan 13, 2026
This issue might be a duplicate of existing issues. Please check:
These issues suggest a broader clipboard handling problem affecting multiple platforms (macOS, Windows, Linux) and terminals (WezTerm, Windows Terminal, MobaXterm). Your specific OSC 52 sequence issue on macOS + WezTerm might be the root cause affecting all platforms.
Feel free to ignore if your issue has specific differences from these.
naydenoff commentedon Jan 13, 2026
Closing as duplicate of #4283. The root cause appears to be the same: broken OSC 52 clipboard handling. Adding my findings to that issue.