Skip to content

tui: mouse drag-selection intermittently fails or sticks partway (macOS, VS Code terminal) #61398

Closed as not planned

Description

@WilliamZimmerman83

Summary

In the TUI running inside VS Code's integrated terminal on macOS, mouse drag-selection of chat text intermittently fails: either the drag highlights nothing at all (so there is nothing to copy), or it highlights only part of the range and then stops extending mid-drag. The rest of the interface stays responsive; only the selection is lost.

Environment

  • opencode version: 2.2.5
  • OS: Darwin 27.2.0 (macOS, arm64, Apple Silicon)
  • Terminal: VS Code integrated terminal (TERM_PROGRAM=vscode, TERM=xterm-256color, COLORTERM=truecolor)
  • Shell: /bin/zsh
  • Install/channel: latest
  • Active plugins: none found in config

Reproduction

  1. Run opencode in the VS Code integrated terminal on macOS, default configuration.
  2. Use a session normally (chat transcript with assistant messages).
  3. Drag-select text in the transcript with the mouse (left button drag) to copy it.
  4. Repeat over the course of normal use — the failure is intermittent.

Expected Behavior

Every drag highlights the dragged range, and the selection can be copied.

Actual Behavior

Intermittently (no pattern identified yet — "happens rather randomly"):

  • the drag does not highlight anything, so nothing can be copied, or
  • the highlight covers only part of the dragged range and then stops extending, as if the drag ended early.

No error is shown, and nothing is written to ~/.local/share/opencode/log/opencode.log when it happens. The TUI otherwise stays responsive (this is not a full freeze).

Additional Context

Activity

  1. opencodejr commented on Nov 3, 2026

    @opencodejr
    Contributor

    Thanks for the detailed report! Since this is intermittent and nothing gets logged, we need a bit more about when it happens before we can try to reproduce it. If you notice any of these during an episode, please share them:

    1. Was a response streaming (the transcript updating or auto-scrolling) while you dragged, or was the session idle?
    2. Did you scroll (wheel or trackpad) while holding the button, or drag past the top or bottom edge of the transcript? Does the partial selection stop exactly where you started scrolling?
    3. Where did the drag start and end? For example, within one message or across several, over code blocks or tables, near the prompt.
    4. Native selection: during an episode, does the terminal's own selection still work? In VS Code on macOS that's usually Option+drag (with terminal.integrated.macOptionClickForcesSelection enabled) or Shift+drag.
    5. Other terminals: does it also happen in iTerm2 or Terminal.app, or only in VS Code's integrated terminal?
    6. If you can, a short screen recording of one episode would help a lot.

    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, ordered by how closely they relate (none looks like the same problem):

  2. opencodejr commented on Nov 6, 2026

    @opencodejr
    Contributor

    Closing this for now, since we haven't heard back. The drag-selection failure is intermittent and leaves nothing in the logs, so we can't try to reproduce it until we know when it happens. For example: whether a response was streaming, whether you scrolled during the drag, whether Option+drag or Shift+drag still worked, and whether it also happens outside VS Code's terminal.

    If you see it again and can share any of those details, or a short screen recording, please reply here and we'll reopen it. Thanks for the thorough report! In the meantime, #61053 and #51056 cover related drag-selection problems.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions