GeezerVison is showing github.com — Can't copy text from opencode through mouse selection in Windows Terminal · Issue #5046 · anomalyco/opencode
Can't copy text from opencode through mouse selection in Windows Terminal #5046DescriptionDescription
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.
Screenshot and/or share link
No response
Operating System
Windows 11
Terminal
Windows Terminal Reacted by Michael Mortensen, Davide Fiocco, jrogers512, David Vadas, Sergei Zharinov, Aidan Sunbury, Hendra wijaya, Macjob, seanmamasde, RogerGdot and 4 more Activitygithub-actions commented on 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 commented on Jan 10, 2026 I'm on mac and if I put opencode under tmux I cant copy text as well wwalker commented on 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.
- 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.
Reacted by Andrey E. Yaromenok and nweiler mhrf commented on 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) 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 zioalex commented on Feb 23, 2026 Same problem in Linux. It can copy but only inside Opencode itself mamorett commented on Mar 1, 2026 same here. I am using opencode in an headless Spark DGX and I cannot copy paste anything within opencode itself. EddyVinck commented on Apr 19, 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)
thank you, that worked for me on Mac using OpenCode in Cmux Daniel15 commented on 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 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.
removed bugSomething isn't working opentuiThis relates to changes in v1.0, now that opencode uses opentui on May 3, 2026emsi commented on 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 commented on Jun 11, 2026 I am using mobaxterm as terminal. I've found a workaround by disabling mouse capturing in TUI -
~/.config/opencode/tui.json:
{
"$schema": "https://opencode.ai/tui.json",
"mouse": false
}
Reacted by Milko Madariaga and AYMEN github-actions commented on 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 commented on 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.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|