Repository navigation
Closed as not planned
Closed as not planned
Copy link
Labels
Description
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
- Run
opencodein the VS Code integrated terminal on macOS, default configuration. - Use a session normally (chat transcript with assistant messages).
- Drag-select text in the transcript with the mouse (left button drag) to copy it.
- 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
- Frequency: intermittent, noticed periodically over regular use.
- Possibly related issues in the mouse-capture/selection family, though symptoms differ:
- tui: drag-selection freezes the interface when mouse capture is enabled #51056 — drag-selection freezes the whole TUI (Linux, VTE terminal, consistently reproducible). Here the UI stays responsive and only the selection fails, on macOS + VS Code terminal.
- Local copy writes the clipboard natively and via OSC 52 at once, racing the terminal (macOS) #59052 — macOS clipboard race between the native write and OSC 52 (there the text still lands in the clipboard; here the selection itself can't be made).
- TUI: "Copied to clipboard" toast shown even when nothing was copied (OSC52 "attempted" treated as success) #59664 — "Copied to clipboard" toast with nothing copied (Linux/VTE without OSC 52 support).
- Suggested diagnostic (not yet tried by reporter): whether Shift+drag (terminal-native selection, bypassing application mouse reporting) works during an episode would indicate the drag events are being captured by the TUI's mouse reporting rather than reaching the terminal's selection.
- Happy to test a
--no-mousestyle override ([FEATURE]: Add --no-mouse and --mouse CLI overrides #60942) or a debug build with mouse-event logging if that helps narrow it down.
Activity
opencodejr commentedon Nov 3, 2026
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:
terminal.integrated.macOptionClickForcesSelectionenabled) or Shift+drag.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):
--no-mouse/--mouseoverrides.opencodejr commentedon Nov 6, 2026
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.