Skip to content

Copy to clipboard broken over SSH (MobaXterm & Windows Terminal) #6111

@b3nw

Description

@b3nw

When running OpenCode over SSH from Windows, the "Copy Message" feature (ctrl+x then y) displays "copied to clipboard" notification, but pasting on Windows does not work. The clipboard contains only the previous content.

This issue makes OpenCode unusable for SSH connections from Windows. Other CLI agents such as Claude Code and Gemini CLI do not block clipboard operations over SSH - they allow normal copy/paste functionality. OpenCode is the only agent with this clipboard limitation.

Steps to Reproduce

  1. Connect from Windows to Debian host via SSH using MobaXterm
  2. Run opencode
  3. Open a session or continue an existing one
  4. Press ctrl+x then y to copy a message
  5. See "copied to clipboard" notification
  6. Paste in Windows (ctrl+v or right-click) - contains old clipboard content only

Expected Behavior
Text should be copied to Windows clipboard and available for pasting

Actual Behavior
Clipboard shows "copied to clipboard" but pasting returns previous clipboard content (often just -`)

Environment

  • OpenCode version: v1.0.132+ (TUI with opentui)
  • Platform: Windows 11
  • Terminal: MobaXterm (latest)
  • SSH target: Debian Linux
  • Connection: Windows → MobaXterm → SSH → Debian → opencode

Additional Testing

  1. Same issue occurs with Windows Terminal instead of MobaXterm
  2. Tested with OPENCODE_EXPERIMENTAL_DISABLE_COPY_ON_SELECT=1 - stops auto-copy-on-select but manual copy (ctrl+x then y) still fails
  3. Without the env var, auto-copy shows same issue (clipboard contains -`)

Metadata

Metadata

Assignees

Labels

opentuiThis relates to changes in v1.0, now that opencode uses opentuiwindows

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions