You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Can't copy text from opencode through mouse selection in Windows Terminal #5046
I've noticed the newly introduced OPENCODE_EXPERIMENTAL_DISABLE_COPY_ON_SELECT which I hoped would make it better for me to copy text from opencode tui, but it doesn't work. I run Windows Terminal > wsl > ubuntu > ssh > tmux > opencode. Whenever I mouse-select text that shows up in opencode, the selection is cleared and nothing is copied to the clipboard. Before toggling the flag, it said "copied to clipboard" (which it didn't, who knows, maybe I need a clipboard forward integration or something). Now it doesn't say "copied to clipboard", but it does not copy, it just clears selection. I've tried in a separate windows terminal tab and the behavior is: select text and only after right click the selection is cleared and the clipboard gets that content.
OpenCode version
1.0.132
Steps to reproduce
Run windows terminal with wsl
open opencode via an ssh connection. First set the environment flag
mouse select some text
I expectat that my selection is copied to the clipboard. Instead, the selection is cleared and nothing happens.
I have the same/similar problem running on linux in an XTerm. Usually it is xterm -> ssh -> tmux -> opencode, but to troubleshoot I an running directly local using XTerm with opencode in it.
double click (select by word) and triple click (select by line) never highlight anything. Something is often in the clipboard, but rarely the thing I was trying to select.
click and drag (select by character) seems to work but opencode is adding newline that aren't there to the selection before putting it in the clipboard.
Until they fix the code to not clear selection, you can shift+mouse drag, this way it wont clear the selection. Then you can copy to clipboard ctrl+c normally. (works in GhosTTY)
Reacted by Jean-Baptiste Mestelan, Hermann Rolfes and Enes Kirimi
Reacted by Aidan Sunbury, Robin Björklin, Tiberiu Ichim, Paul Maxwell and tom-jadeai
Reacted by Khaled Ferjani, torryt, YiHong Chen, Michael Mortensen, Jacob Vanus, Wei, Daniel Macías Gómez, Leni_v, Arthur Drozdov, Daniel Katson and 10 more
Until they fix the code to not clear selection, you can shift+mouse drag, this way it wont clear the selection. Then you can copy to clipboard ctrl+c normally. (works in GhosTTY)
thank you, that worked for me on Mac using OpenCode in Cmux
It seems terminal dependent. Copy on select works fine in the terminal in VS Code, and in Konsole (KDE's default terminal), but not GNOME Terminal. I suspect there's some terminal-specific capability that it should be checking for.
You can set the environment variable OPENCODE_EXPERIMENTAL_DISABLE_COPY_ON_SELECT to 1 to disable copy on select. This will retain the selection, and then you can press Ctrl+C like normal.
Sorry, I didn't see you already mentioned this.
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.
This is really making the use in vs code in web very difficult. I cannot select the text at all. When I set mouse to false in tui, all scroll stops. And even then the copy is not working at all.
Activity
github-actions commentedon Dec 4, 2025
This issue might be a duplicate of existing issues. Please check:
Feel free to ignore if none of these address your specific case.
kajeagentspi commentedon Jan 10, 2026
I'm on mac and if I put opencode under tmux I cant copy text as well
wwalker commentedon Jan 14, 2026
I have the same/similar problem running on linux in an XTerm. Usually it is xterm -> ssh -> tmux -> opencode, but to troubleshoot I an running directly local using XTerm with opencode in it.
mhrf commentedon Jan 17, 2026
Until they fix the code to not clear selection, you can shift+mouse drag, this way it wont clear the selection. Then you can copy to clipboard ctrl+c normally. (works in GhosTTY)
zioalex commentedon Feb 23, 2026
Same problem in Linux. It can copy but only inside Opencode itself
mamorett commentedon Mar 1, 2026
same here. I am using opencode in an headless Spark DGX and I cannot copy paste anything within opencode itself.
EddyVinck commentedon Apr 19, 2026
thank you, that worked for me on Mac using OpenCode in Cmux
Daniel15 commentedon Apr 22, 2026
It seems terminal dependent. Copy on select works fine in the terminal in VS Code, and in Konsole (KDE's default terminal), but not GNOME Terminal. I suspect there's some terminal-specific capability that it should be checking for.
You can set the environment variableOPENCODE_EXPERIMENTAL_DISABLE_COPY_ON_SELECTto1to disable copy on select. This will retain the selection, and then you can press Ctrl+C like normal.Sorry, I didn't see you already mentioned this.
emsi commentedon May 8, 2026
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.
Samfaitmal commentedon Jun 11, 2026
I am using mobaxterm as terminal. I've found a workaround by disabling mouse capturing in TUI -
~/.config/opencode/tui.json:
github-actions commentedon Aug 11, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.
xibsked commentedon Aug 19, 2026
This is really making the use in vs code in web very difficult. I cannot select the text at all. When I set mouse to false in tui, all scroll stops. And even then the copy is not working at all.