clipboard copy not works in remote SSH console. #1821

Closed
opened 2026-02-16 17:32:48 -05:00 by yindo · 26 comments
Owner

Originally created by @magic-thomas on GitHub (Sep 25, 2025).

Originally assigned to: @kommander on GitHub.

hi .
Sometimes I use opencode / claude code in remote SSH console.

Claude Code allows copy selected text.

But I can not copy text in remote console with Opencode.

Is it intended or missing or is there a way to copy text ?

Originally created by @magic-thomas on GitHub (Sep 25, 2025). Originally assigned to: @kommander on GitHub. hi . Sometimes I use opencode / claude code in remote SSH console. Claude Code allows copy selected text. But I can not copy text in remote console with Opencode. Is it intended or missing or is there a way to copy text ?
yindo added the opentui label 2026-02-16 17:32:48 -05:00
yindo closed this issue 2026-02-16 17:32:48 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Sep 25, 2025):

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

  • #2114: Reports no way to select or copy text in output messages on macOS with Ghostty terminal
  • #2755: Feature request for copy mode functionality, mentions tmux copy mode not working properly with OpenCode
  • #2118: Requests /copy command due to issues with text selection and copying

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Sep 25, 2025): This issue might be a duplicate of existing issues. Please check: - #2114: Reports no way to select or copy text in output messages on macOS with Ghostty terminal - #2755: Feature request for copy mode functionality, mentions tmux copy mode not working properly with OpenCode - #2118: Requests /copy command due to issues with text selection and copying Feel free to ignore if none of these address your specific case.
Author
Owner

@rekram1-node commented on GitHub (Sep 25, 2025):

This should be fixed in next version of the tui, rn it is being rewritten: https://github.com/sst/opencode/pull/2685

@rekram1-node commented on GitHub (Sep 25, 2025): This should be fixed in next version of the tui, rn it is being rewritten: https://github.com/sst/opencode/pull/2685
Author
Owner

@W1BTR commented on GitHub (Nov 21, 2025):

Still having this issue on opencode installed today. Has this new TUI been released yet?

@W1BTR commented on GitHub (Nov 21, 2025): Still having this issue on opencode installed today. Has this new TUI been released yet?
Author
Owner

@rekram1-node commented on GitHub (Nov 21, 2025):

yeah, maybe a tmux issue for u?

@rekram1-node commented on GitHub (Nov 21, 2025): yeah, maybe a tmux issue for u?
Author
Owner

@kommander commented on GitHub (Nov 22, 2025):

Yes, proper osc52 handling is missing, opencode currently only copies to local clipboard. Opentui should provide a copyToClipboard method to handle that properly.

@kommander commented on GitHub (Nov 22, 2025): Yes, proper osc52 handling is missing, opencode currently only copies to local clipboard. Opentui should provide a copyToClipboard method to handle that properly.
Author
Owner

@thevinchi commented on GitHub (Nov 23, 2025):

fwiw: I'm having this issue as well. I use tmux, but it WAS working fine before the 1.0 release. That's when copy broke for me.

@thevinchi commented on GitHub (Nov 23, 2025): fwiw: I'm having this issue as well. I use tmux, but it WAS working fine before the 1.0 release. That's when copy broke for me.
Author
Owner

@travofoz commented on GitHub (Nov 26, 2025):

im on 114 and the issue persists. it is extremely frustrating

@travofoz commented on GitHub (Nov 26, 2025): im on 114 and the issue persists. it is extremely frustrating
Author
Owner

@aaronnewsome commented on GitHub (Dec 7, 2025):

i tried a lot of ways to get select text and copy to clipboard working with opencode in an ssh session. the only thing I could get to work was to use guacamole and ssh. it works but i'd rather not have to use this method.

how are others successfully able to copy text over an ssh session? why has this been such a persistent problem? most other terminal coders don't have this issue.

i really like opencode and it's my daily driver but this copy thing has me vexed for real.

my current workflow is to work normally in a regular tmux/ssh session. then in the rare case where I have to copy something, i fire up a guacamole session, ssh into the host, tmux attach, select the text, which gets copied into the clipboard of the browser/host where i'm sitting. tmux detach then go back to my regular terminal.

it works, but what a hack. i should be able to just select and copy text like any other terminal.

sometimes I can get the text with the /export command and once in vim select copy works normally, but that always doesn't work since not everything in the conversation shows up in the export.

I, for one would be very pleased if this issue were fixed.

@aaronnewsome commented on GitHub (Dec 7, 2025): i tried a lot of ways to get select text and copy to clipboard working with opencode in an ssh session. the only thing I could get to work was to use guacamole and ssh. it works but i'd rather not have to use this method. how are others successfully able to copy text over an ssh session? why has this been such a persistent problem? most other terminal coders don't have this issue. i really like opencode and it's my daily driver but this copy thing has me vexed for real. my current workflow is to work normally in a regular tmux/ssh session. then in the rare case where I have to copy something, i fire up a guacamole session, ssh into the host, tmux attach, select the text, which gets copied into the clipboard of the browser/host where i'm sitting. tmux detach then go back to my regular terminal. it works, but what a hack. i should be able to just select and copy text like any other terminal. sometimes I can get the text with the /export command and once in vim select copy works normally, but that always doesn't work since not everything in the conversation shows up in the export. I, for one would be very pleased if this issue were fixed.
Author
Owner

@b3nw commented on GitHub (Dec 23, 2025):

1.0.193 using ssh/MobaXterm this is still broken.

@b3nw commented on GitHub (Dec 23, 2025): 1.0.193 using ssh/MobaXterm this is still broken.
Author
Owner

@pvoo commented on GitHub (Dec 30, 2025):

Same issue here on remote session via SSH

@pvoo commented on GitHub (Dec 30, 2025): Same issue here on remote session via SSH
Author
Owner

@juanqui commented on GitHub (Dec 30, 2025):

Same issue here :( I can't seem to figure out how to copy anything from the terminal. This is a big bummer.

@juanqui commented on GitHub (Dec 30, 2025): Same issue here :( I can't seem to figure out how to copy anything from the terminal. This is a big bummer.
Author
Owner

@thevinchi commented on GitHub (Jan 3, 2026):

I know it's not my setup/config because copy to clipboard worked great before 1.0.

@thevinchi commented on GitHub (Jan 3, 2026): I know it's not my setup/config because copy to clipboard worked great before 1.0.
Author
Owner

@phantooom commented on GitHub (Jan 5, 2026):

i met the same problem. i use iterm2 ssh to an arch linux. opencode clipboard not work.

@phantooom commented on GitHub (Jan 5, 2026): i met the same problem. i use iterm2 ssh to an arch linux. opencode clipboard not work.
Author
Owner

@elijahmorg commented on GitHub (Jan 6, 2026):

I have this issue.

Mac -> Ghostty -> ssh -> Ubuntu -> tmux -> clipboard copy does not work.

Works when not using tmux.

@elijahmorg commented on GitHub (Jan 6, 2026): I have this issue. Mac -> Ghostty -> ssh -> Ubuntu -> tmux -> clipboard copy does not work. Works when not using tmux.
Author
Owner

@thevinchi commented on GitHub (Jan 6, 2026):

Mac -> Ghostty -> ssh -> Ubuntu -> tmux -> clipboard copy does not work.

I have the same setup except iTerm2 instead of Ghostty which was working great before the 1.0.0 release.

@thevinchi commented on GitHub (Jan 6, 2026): > Mac -> Ghostty -> ssh -> Ubuntu -> tmux -> clipboard copy does not work. I have the same setup except `iTerm2` instead of `Ghostty` which was working great before the `1.0.0` release.
Author
Owner

@b3nw commented on GitHub (Jan 6, 2026):

MobaXterm (Windows 11) -> Debian also experiences this bug.

@b3nw commented on GitHub (Jan 6, 2026): MobaXterm (Windows 11) -> Debian also experiences this bug.
Author
Owner

@ekroon commented on GitHub (Jan 7, 2026):

@elijahmorg @thevinchi Do you have something like this in your tmux.conf?

set -g allow-passthrough on

Without it I have the same problem.

@ekroon commented on GitHub (Jan 7, 2026): @elijahmorg @thevinchi Do you have something like this in your tmux.conf? ``` set -g allow-passthrough on ``` Without it I have the same problem.
Author
Owner

@W1BTR commented on GitHub (Jan 7, 2026):

This is the biggest issue keeping me from using opencode - it'd be really convenient to be able to switch to another model when one runs out of quota. There are other small creature comforts apps like claude-code has but this is the biggest one.

@W1BTR commented on GitHub (Jan 7, 2026): This is the biggest issue keeping me from using opencode - it'd be really convenient to be able to switch to another model when one runs out of quota. There are other small creature comforts apps like claude-code has but this is the biggest one.
Author
Owner

@elijahmorg commented on GitHub (Jan 7, 2026):

@elijahmorg @thevinchi Do you have something like this in your tmux.conf?

set -g allow-passthrough on

Without it I have the same problem.

This worked for me! Thanks!

Hopefully that doesn't something else.

@thevinchi does this help you?

@elijahmorg commented on GitHub (Jan 7, 2026): > [@elijahmorg](https://github.com/elijahmorg) [@thevinchi](https://github.com/thevinchi) Do you have something like this in your tmux.conf? > > ``` > set -g allow-passthrough on > ``` > > Without it I have the same problem. This worked for me! Thanks! Hopefully that doesn't something else. @thevinchi does this help you?
Author
Owner

@thevinchi commented on GitHub (Jan 8, 2026):

@elijahmorg @thevinchi Do you have something like this in your tmux.conf?

set -g allow-passthrough on

Without it I have the same problem.

This worked for me! Thanks!

Hopefully that doesn't something else.

@thevinchi does this help you?

@elijahmorg @ekroon

Yeah, my tmux.conf already has this setting.

Clipboard works beautifully when:

iTerm2->ssh->tmux->nvim (and anything else)

However, clipboard does not work when:

iTerm2->ssh->tmux->opencode

@thevinchi commented on GitHub (Jan 8, 2026): > > [@elijahmorg](https://github.com/elijahmorg) [@thevinchi](https://github.com/thevinchi) Do you have something like this in your tmux.conf? > > > > ``` > > set -g allow-passthrough on > > ``` > > > > Without it I have the same problem. > > This worked for me! Thanks! > > Hopefully that doesn't something else. > > @thevinchi does this help you? @elijahmorg @ekroon Yeah, my tmux.conf already has this setting. Clipboard works beautifully when: `iTerm2->ssh->tmux->nvim (and anything else)` However, clipboard does not work when: `iTerm2->ssh->tmux->opencode`
Author
Owner

@lee-b commented on GitHub (Jan 9, 2026):

Yes, proper osc52 handling is missing, opencode currently only copies to local clipboard. Opentui should provide a copyToClipboard method to handle that properly.

Yes, the OSC 52 (terminal/OS control sequence) appears to be the closest "correct" solution for true clipboard use over ssh, because it proxies clipboard access via the terminal itself, without requiring X forwarding. OSC 52 is technically a de facto standard, but it was introduced by xterm itself, and follows the OSC standard from ECMA-48.

Example code, possibly useful (embeddable?) utility, and a table of terminals which support this:

https://github.com/theimpostor/osc

Selection-based copy/paste should also be supported in a terminal, of course.

@lee-b commented on GitHub (Jan 9, 2026): > Yes, proper osc52 handling is missing, opencode currently only copies to local clipboard. Opentui should provide a copyToClipboard method to handle that properly. Yes, the OSC 52 (terminal/OS control sequence) appears to be the closest "correct" solution for true clipboard use over ssh, because it proxies clipboard access via the terminal itself, without requiring X forwarding. OSC 52 is technically a _de facto_ standard, but it was introduced by xterm itself, and follows the OSC standard from ECMA-48. Example code, possibly useful (embeddable?) utility, and a table of terminals which support this: https://github.com/theimpostor/osc Selection-based copy/paste should also be supported in a terminal, of course.
Author
Owner

@practicusai commented on GitHub (Jan 9, 2026):

This is the top blocker for us.. is there a timeline for OSC 52 support?

@practicusai commented on GitHub (Jan 9, 2026): This is the top blocker for us.. is there a timeline for OSC 52 support?
Author
Owner

@wunki commented on GitHub (Jan 11, 2026):

This is how I got it to work, may help people: https://petar.dev/notes/copypaste-for-opencode-with-ghostty-and-tmux/

@wunki commented on GitHub (Jan 11, 2026): This is how I got it to work, may help people: https://petar.dev/notes/copypaste-for-opencode-with-ghostty-and-tmux/
Author
Owner

@practicusai commented on GitHub (Jan 11, 2026):

This is how I got it to work, may help people: https://petar.dev/notes/copypaste-for-opencode-with-ghostty-and-tmux/

We use VSCode on web via code-server. After some research, it seemed to me native OSC52 support is the only solution.

@practicusai commented on GitHub (Jan 11, 2026): > This is how I got it to work, may help people: https://petar.dev/notes/copypaste-for-opencode-with-ghostty-and-tmux/ We use VSCode on web via code-server. After some research, it seemed to me native OSC52 support is the only solution.
Author
Owner

@Rhiz3K commented on GitHub (Jan 16, 2026):

this is driving me crazy as I only use opencode on remote machine via SSH

@Rhiz3K commented on GitHub (Jan 16, 2026): this is driving me crazy as I only use opencode on remote machine via SSH
Author
Owner

@thevinchi commented on GitHub (Jan 20, 2026):

FYI: This has been resolved for me as of 1.1.26 (https://github.com/Latitudes-Dev/shuvcode/pull/309)

I see that #9374 is now open, so hopefully whatever is needed to resolve that issue doesn't break whatever is allowing me to copy to clipboard again! 😆

@thevinchi commented on GitHub (Jan 20, 2026): FYI: This has been resolved for me as of 1.1.26 (https://github.com/Latitudes-Dev/shuvcode/pull/309) I see that #9374 is now open, so hopefully whatever is needed to resolve that issue doesn't break whatever is allowing me to copy to clipboard again! 😆
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#1821