anomalyco / anomalyco/opencode
Clipboard copying does not work when OpenCode is running over SSH
@simonklee is already working on this.
Since Aug 31, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Description
Environment
- Local terminal: GNOME Terminal 3.52.0 using VTE 0.76.0 +BIDI +GNUTLS +ICU +SYSTEMD
- Local shell: zsh 5.9 (x86_64-ubuntu-linux-gnu)
- Local
TERM:xterm-256color - Local
COLORTERM:truecolor - Remote device: Raspberry Pi
- Remote OS: Debian 12
- Remote shell: bash
- Remote
TERM:xterm-256color - Remote
COLORTERM: unset - SSH: OpenSSH 9.2p1
- OpenCode: 1.18.25
Plugins
None
Description
Clipboard copying does not work when OpenCode is running inside an SSH session.
Normal terminal output can be copied successfully from the same SSH session, so the issue does not appear to be related to SSH or the terminal's clipboard functionality.
The problem occurs specifically with text displayed by OpenCode.
There are two related behaviors that do not work:
- Selecting text in OpenCode does not result in the selected text being copied to the clipboard.
- OpenCode's automatic copy behavior, where selecting text causes OpenCode to display a "Copied to clipboard" notification, does not actually copy the text to the clipboard.
Reproduction
- Open GNOME Terminal.
- SSH into a Raspberry Pi running Debian 12.
- Start OpenCode.
- Select some text displayed by OpenCode.
- Observe the clipboard behavior.
For comparison, exit OpenCode and run:
printf 'COPY TEST 123456789\n'
Selecting and copying this text works correctly.
Expected behavior
Selecting text in OpenCode should copy the selected text to the clipboard, including when OpenCode is running through an SSH session.
If OpenCode displays a "Copied to clipboard" notification, the selected text should actually be available in the local clipboard.
Actual behavior
The OpenCode selection/copy operation does not place the selected text into the local clipboard.
Normal copying from the underlying SSH terminal works correctly.
This makes the issue appear to be specific to OpenCode's terminal/TUI clipboard handling rather than SSH or GNOME Terminal itself.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.