opencode icon indicating copy to clipboard operation
opencode copied to clipboard

clipboard copy not works in remote SSH console.

Open magic-thomas opened this issue 3 months ago • 11 comments

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 ?

magic-thomas avatar Sep 25 '25 07:09 magic-thomas

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] avatar Sep 25 '25 07:09 github-actions[bot]

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

rekram1-node avatar Sep 25 '25 18:09 rekram1-node

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

W1BTR avatar Nov 21 '25 16:11 W1BTR

yeah, maybe a tmux issue for u?

rekram1-node avatar Nov 21 '25 21:11 rekram1-node

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

kommander avatar Nov 22 '25 19:11 kommander

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 avatar Nov 23 '25 11:11 thevinchi

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

travofoz avatar Nov 26 '25 06:11 travofoz

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 avatar Dec 07 '25 16:12 aaronnewsome