Skip to content

V2/tui/linux: Impossible to select text with the mouse when another session is working on something #54509

Closed as not planned

Description

@kmatheussen

Description

If another session is working on something, it's impossible to select text with the mouse (for copying to clipboard) because the top of the terminal is updated, displaying animated tui-graphics. This causes any selection to automatically be cancelled because all of the text in the terminal seems to be updated. If you are extremely quick to select, it may work, but it's not possible in practice for a human.

As a workaround, is it possible to turn off the top bar which displays what the other sessions are terminal working with? Perhaps this is the only way to fix it?

Maybe there's another workaround? Maybe I need to use another type of terminal? I'm just using gnome-terminal now.

Plugins

No plugins installed as far as I know.

OpenCode version

opencode v2.0.26

Steps to reproduce

  1. Start two opencode sessions in two different terminals.
  2. Let the first terminal work on a big job.
  3. In the second terminal, it's now impossible to select text with the mouse (for copying to clipboard) because the top of the terminal is updated, displaying graphics indicating that another session is working on something. This causes any selection to automatically be cancelled because all of the text in the terminal seems to be updated. If you are extremely quick to select, it may work, but it's not possible in practice for a human.

Screenshot and/or share link

Not necessary I think.

Operating System

Terminal runs on Linux fedora 43. This terminal ssh into a macos 26.4 computer running opencode.

Terminal

gnome-terminal

Activity

  1. opencode-agent commented on Oct 11, 2026

    @opencode-agent
    Contributor

    Thanks for the report! I tried to reproduce this with OpenCode v2.0.26 (the latest release, since no version was given). I had two OpenCode TUIs open on the same project: one ran a long, slowly streaming response, and the other's tab strip showed that session with its busy spinner. In the second TUI I dragged over some transcript text and held the mouse button. The selection stayed highlighted while the spinner kept animating, and releasing it copied the text as normal. So I couldn't reproduce it with OpenCode's own (default) mouse selection.

    My guess is that you're using gnome-terminal's own selection rather than OpenCode's, which gnome-terminal can drop when the screen is redrawn. I couldn't test that here. Could you tell us:

    • Your version (opencode --version).
    • How you select: a plain drag, or Shift+drag? Do you have "mouse": false in ~/.config/opencode/cli.json?
    • When the selection works, does OpenCode show a "Copied to clipboard" toast? (That would mean it's OpenCode's selection, not the terminal's.)
    • Does it also happen in another terminal, for example kitty, Alacritty or WezTerm?

    As a workaround in the meantime, you can try either of these in ~/.config/opencode/cli.json (I haven't confirmed they fix it):

    { "tabs": { "mode": "off" } }

    turns off the session tab strip at the top, or

    { "animations": false }

    turns off interface animations. With the default mouse settings, plain drag-select in OpenCode then press Ctrl+C (or just release, if copy-on-select is on) should also work.

    You can reply here with the details, or edit the issue; if you edit it, please also leave a comment saying you've updated it so we know you're done.

    Related issues I found, though none look like the same problem: #51056 (drag-selection freezes the TUI on a VTE-based terminal), #47632 (selection cleared by page up/down keybinds) and #41692 (selection includes the context pane).

  2. kmatheussen commented on Oct 11, 2026

    @kmatheussen
    Author

    Yes, I have "mouse": false in ~/.config/opencode/cli.json . I need to do this because copying to clipboard doesn't work over ssh. (Also, it's more convenient to paste by using the middle-button than to press Ctrl+V/etc.). I tried to set mouse to true though, and then selecting text worked, but as expected, copying to clipboard doesn't work when doing that.

    However! Both { "tabs": { "mode": "off" } } and { "animations": false } worked.

    So on my part, the problem is fixed. Thanks!

  3. opencode-agent commented on Oct 11, 2026

    @opencode-agent
    Contributor

    Thanks for confirming, and glad it works for you now!

    To sum up for anyone who finds this later: with "mouse": false, selection is handled by the terminal (gnome-terminal here), not by OpenCode. When another session is busy, its tab at the top animates and redraws the screen, and that redraw clears the terminal's selection. Either of these settings in ~/.config/opencode/cli.json avoids it:

    { "tabs": { "mode": "off" } }

    or

    { "animations": false }

    If copying to the clipboard over SSH with mouse capture on is something you'd like to see improved, feel free to open a separate issue for it.

    As this is resolved for you, the bot will close this issue in a few days unless you reply that something is still wrong.

  4. opencode-agent commented on Oct 14, 2026

    @opencode-agent
    Contributor

    Closing this now, since you confirmed it's resolved. To recap: with "mouse": false, gnome-terminal handles the selection itself. When another session is busy, its tab at the top animates and redraws the screen, and that redraw clears the terminal's selection. Setting { "tabs": { "mode": "off" } } or { "animations": false } in ~/.config/opencode/cli.json avoids it. Thanks for the report and for testing the workarounds! If it comes back, or you'd like to raise clipboard copying over SSH, feel free to open a new issue.

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

Metadata

Metadata

Assignees

No one assigned

    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