Can't copy text from opencode through mouse selection in Windows Terminal #3291

Open
opened 2026-02-16 17:39:32 -05:00 by yindo · 4 comments
Owner

Originally created by @tiberiuichim on GitHub (Dec 4, 2025).

Description

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

  1. Run windows terminal with wsl
  2. open opencode via an ssh connection. First set the environment flag
  3. mouse select some text
  4. 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

Originally created by @tiberiuichim on GitHub (Dec 4, 2025). ### Description 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 1. Run windows terminal with wsl 2. open opencode via an ssh connection. First set the environment flag 3. mouse select some text 4. 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
yindo added the opentuibug labels 2026-02-16 17:39:32 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Dec 4, 2025):

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

  • #4283: Copy To Clipboard is not working - similar clipboard functionality issue
  • #2773: clipboard copy not works in remote SSH console - copy not working in remote environments (SSH/WSL)
  • #4754: Copy and Paste behaviour under Linux - related to clipboard handling across different platforms
  • #4751: [FEATURE]: Add config option to disable copy-on-select - the feature request that led to the OPENCODE_EXPERIMENTAL_DISABLE_COPY_ON_SELECT flag

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

@github-actions[bot] commented on GitHub (Dec 4, 2025): This issue might be a duplicate of existing issues. Please check: - #4283: Copy To Clipboard is not working - similar clipboard functionality issue - #2773: clipboard copy not works in remote SSH console - copy not working in remote environments (SSH/WSL) - #4754: Copy and Paste behaviour under Linux - related to clipboard handling across different platforms - #4751: [FEATURE]: Add config option to disable copy-on-select - the feature request that led to the OPENCODE_EXPERIMENTAL_DISABLE_COPY_ON_SELECT flag Feel free to ignore if none of these address your specific case.
Author
Owner

@kajeagentspi commented on GitHub (Jan 10, 2026):

I'm on mac and if I put opencode under tmux I cant copy text as well

@kajeagentspi commented on GitHub (Jan 10, 2026): I'm on mac and if I put opencode under tmux I cant copy text as well
Author
Owner

@wwalker commented on GitHub (Jan 13, 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.

  1. 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.
  2. 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.
@wwalker commented on GitHub (Jan 13, 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. 1. 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. 2. 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.
Author
Owner

@mhrf commented on GitHub (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)

@mhrf commented on GitHub (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)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#3291