Skip to content

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

Closed as not planned

Description

@tiberiuichim

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

Activity

  1. added
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Dec 4, 2025
  2. github-actions commented on Dec 4, 2025

    @github-actions
    Contributor

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

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

  3. kajeagentspi commented on Jan 10, 2026

    @kajeagentspi

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

  4. wwalker commented on Jan 14, 2026

    @wwalker

    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.
  5. mhrf commented on Jan 17, 2026

    @mhrf

    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)

  6. zioalex commented on Feb 23, 2026

    @zioalex

    Same problem in Linux. It can copy but only inside Opencode itself

  7. mamorett commented on Mar 1, 2026

    @mamorett

    same here. I am using opencode in an headless Spark DGX and I cannot copy paste anything within opencode itself.

  8. EddyVinck commented on Apr 19, 2026

    @EddyVinck

    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

  9. Daniel15 commented on Apr 22, 2026

    @Daniel15

    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.

  10. removed
    bugSomething isn't working
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on May 3, 2026
  11. emsi commented on May 8, 2026

    @emsi

    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.

  12. Samfaitmal commented on Jun 11, 2026

    @Samfaitmal

    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
    }
    
  13. github-actions commented on Aug 11, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

  14. xibsked commented on Aug 19, 2026

    @xibsked

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions