GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Copy to clipboard broken over SSH (MobaXterm & Windows Terminal) · Issue #6111 · anomalyco/opencode

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

New issue
Copy link
New issue
Copy link
Closed
anomalyco/opentui
#546
anomalyco/opentui#546
Closed
Copy to clipboard broken over SSH (MobaXterm & Windows Terminal)#6111
anomalyco/opentui
#546
Copy link
Assignees
kommander
Labels
opentuiThis relates to changes in v1.0, now that opencode uses opentuiwindows

Description

@b3nw
b3nw
opened on Dec 24, 2025
Issue body actions

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 -`)
Reacted by kha84, Josip Križan, Christoph Döllinger and WTFChuck (Charles Scoville)

Activity

  1. github-actions
    assigned
    kommander
    on Dec 24, 2025
  2. github-actions
    added
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    windows
    on Dec 24, 2025
  3. github-actions commented on Dec 24, 2025

    @github-actions
    github-actionsBot
    on Dec 24, 2025 – with GitHub Actions
    Contributor
    More actions

    This issue might be a duplicate of existing issues. Please check:

    • clipboard copy not works in remote SSH console. #2773: clipboard copy not works in remote SSH console
    • Copy To Clipboard is not working #4283: Copy To Clipboard is not working
    • Can't copy text from opencode through mouse selection in Windows Terminal #5046: Can't copy text from opencode through mouse selection in Windows Terminal

    These issues all describe similar clipboard functionality problems in various SSH and Windows environments. Feel free to ignore if your specific case differs from these.

  4. Son0fSun
    added 3 commits that reference this issue on Jan 17, 2026

    feat(clipboard): add OSC 52 clipboard support for SSH/remote sessions

    8e9b138

    fix(clipboard): improve OSC 52 escape sequence for SSH compatibility

    ef6ab63

    fix(clipboard): improve OSC 52 escape sequence for SSH compatibility

    8a1ce2e
  5. nikhilmaddirala commented on Jan 17, 2026

    @nikhilmaddirala
    nikhilmaddirala
    on Jan 17, 2026
    More actions

    I am experiencing this exact issue running OpenCode inside Zellij over SSH.

    Environment:

    • Local: Local Machine (Terminal Emulator)
    • Remote: Linux Server
    • Session: SSH -> Zellij -> OpenCode
    • OpenCode Version: v1.1.13

    Behavior:

    1. I select text in OpenCode and hit copy.
    2. OpenCode UI says "Copied to clipboard".
    3. Pasting on my local machine yields old clipboard content.
    4. Contrast: Running neovim in the same Zellij session allows copying perfectly (likely because Neovim handles OSC 52 correctly).

    It seems OpenCode is attempting to write to the remote system clipboard rather than emitting the OSC 52 escape sequence required for remote terminals/multiplexers like Zellij.

  6. b3nw commented on Jan 17, 2026

    @b3nw
    b3nw
    on Jan 17, 2026
    ContributorAuthor
    More actions

    this got resolved in #8974 so should be apart of the next version.

  7. b3nw
    closed this as completedon Jan 17, 2026
  8. skironDotNet commented on Jan 23, 2026

    @skironDotNet
    skironDotNet
    on Jan 23, 2026
    More actions

    Same on putty, although I don't think SSH client matters it seems like opencode runs some terminal UI that is not passthru the copy/paste happens inside the UI. The normal Ctrl+C sends terminate signal, so copy can be invoked via right click but this paste the text back immediately. The is no right click context menu to copy selected text. Copy/paste host/SSH is necessary or create own client SSH software to interact with opencode via SSH

  9. jrevenga commented on Feb 3, 2026

    @jrevenga
    jrevenga
    on Feb 3, 2026
    More actions

    Vamos a hacerlo permanente:

    ● Update(.tmux.conf)
    ⎿  Added 3 lines
    38 set -g default-terminal "tmux-256color"
    39 set -ga terminal-overrides ",*:Tc"
    40
    41 +# OSC 52 clipboard passthrough (needed for OpenCode and other TUI apps
    + over SSH)
    42 +set -g allow-passthrough on
    43 +
    44 set -s extended-keys off
    45
    46 # Modo vim

    ● Listo. El problema era simple al final: tmux bloqueaba las secuencias OSC 52 que
    OpenCode usa para comunicarse con tu clipboard de Windows a través de WezTerm.

    Resumen:
    ┌───────────────────┬───────┬─────────┐
    │ Configuración │ Antes │ Después │
    ├───────────────────┼───────┼─────────┤
    │ allow-passthrough │ off │ on │
    └───────────────────┴───────┴─────────┘
    Las otras aplicaciones funcionaban porque probablemente usan el clipboard interno de
    tmux (set-clipboard external), mientras que OpenCode envía secuencias OSC 52 directas
    que necesitan pasar a través de tmux sin modificar.

    Ya quedó configurado permanentemente en tu .tmux.conf. Problema resuelto. 🎯

  10. skironDotNet commented on Feb 5, 2026

    @skironDotNet
    skironDotNet
    on Feb 5, 2026
    More actions

    I just expose the built in Web UI and no need to talk via terminal. I think many people may be missing the concept. You just run opencode web and work via UI
    If you run oc from a docker container then just expose the web port.
    You can configure web access specifics via ~/.config/opencode/opencode.json

    If using docker container you can mount that file from your host.
    The ~/.config/opencode/opencode.json does not exist by default so you need to create it if you want to customize. It's all well documented. If in doubt ask AI ;)

    Reacted by WTFChuck (Charles Scoville)
    Reacted by Aleksandr, florisdipt, mr.The and Christoph Döllinger
    Reacted by ukrolelo
    Reacted by ukrolelo
    Reacted by ukrolelo
  11. emsi commented on May 8, 2026

    @emsi
    emsi
    on May 8, 2026
    More actions

    No properly behaving terminal application depends on external tools for text selection and copy. On X11 no-one even needs to "copy" as selected text is immediately available for being pasted. opencode is completely broken, does not work over remote session, inside container etc. It generally is misbehaving application that damages your terminal and should be avoided.

  12. MrDoe commented on Sep 23, 2026

    @MrDoe
    MrDoe
    on Sep 23, 2026
    More actions

    This is still not fixed (Opencode v2) when connecting via PuTTY.

    Reacted by zonay
  13. CharlesScoville commented on Oct 11, 2026

    @CharlesScoville
    CharlesScoville
    on Oct 11, 2026
    More actions

    Can confirm, still not fixed. Windows 10, SSH to Debian server via PowerShell.

    Having a CLI but not having copy-paste is like having a mouse but no mouse pointer; the hell are you devs doing?

  14. skironDotNet commented on Oct 12, 2026

    @skironDotNet
    skironDotNet
    on Oct 12, 2026
    More actions

    Just run opencode web
    You don't need to terminal just use the Web UI and your copy paste will work. The UI is like terminal just better

    Reacted by WTFChuck (Charles Scoville)
    Reacted by Denys Tarasov, MacManas and b1tcorso
  15. b1tcorso commented on Nov 23, 2026

    @b1tcorso
    b1tcorso
    on Nov 23, 2026
    More actions

    Can confirm, still not fixed Windows 11 SSH to Debian 13 server via Terminal.

    Any news?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @kommander
    kommander

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

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.