anomalyco / anomalyco/opencode

Clipboard copying does not work when OpenCode is running over SSH

Open
#46,377 2 comments 0 reactions 1 assignee View on GitHub

@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:

  1. Selecting text in OpenCode does not result in the selected text being copied to the clipboard.
  2. 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
  1. Open GNOME Terminal.
  2. SSH into a Raspberry Pi running Debian 12.
  3. Start OpenCode.
  4. Select some text displayed by OpenCode.
  5. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.