Skip to content

feat: Add option to disable mouse capture in TUI for better terminal multiplexer compatibility #7926

Closed as not planned

Description

@LEON-gittech

Description

When running OpenCode inside terminal multiplexers like Zellij or tmux, the TUI's mouse capture prevents normal copy operations:

  1. Mouse selection - captured by TUI, can't use native terminal selection
  2. Ctrl+C - exits OpenCode instead of copying selected text

While Shift+mouse works as a workaround in some terminals, this is not intuitive and doesn't work consistently across all setups.

Proposal

Add a configuration option to disable mouse capture entirely:

// opencode.json
{
  "tui": {
    "mouse": false
  }
}

Or via environment variable:

OPENCODE_DISABLE_MOUSE=true opencode

Rationale

OpenCode TUI doesn't heavily rely on mouse interactions - the primary workflow is keyboard-driven. Users who prefer mouse-based text selection over TUI mouse features should have the option to disable capture.

Environment

  • Terminal: Zellij / tmux
  • OS: Linux
  • OpenCode version: latest

Activity

  1. added
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Jan 12, 2026
  2. wwalker commented on Jan 15, 2026

    @wwalker

    +1, this issue makes opencode almost completely unusable for me.

    Environment:

    • tmux
    • XTerm
    • Fedora Linux and Ubuntu Linux
    • OpenCode version: latest
  3. onyedikachi23 commented on Feb 2, 2026

    @onyedikachi23

    I need this, pls.

  4. VRuzhentsov commented on Feb 13, 2026

    @VRuzhentsov

    Additional somewhat related usecase:

    When I'm switching between windows, I can accidentally click the wrong answer of the Question tool by clicking an area not meant to be clickable.
    This config will help prevent "missclick".

  5. max-foss commented on Mar 4, 2026

    @max-foss

    +1 from me, the current behaviour is unusable on the macOS default terminal breaking copy-/paste which works perfectly with the two big competitors, both starting with C.

  6. victorkzam commented on Mar 11, 2026

    @victorkzam

    +1 also the virtual scrolling makes the experience much worse to use in smaller screens

  7. rsl-pseudocode commented on Mar 13, 2026

    @rsl-pseudocode

    Why is mouse even the default. I just want to turn it off, really frustrating

  8. Ero98 commented on Mar 28, 2026

    @Ero98

    Disabling mouse capture has the same effect as shift drag copying. When doing multi-line copying, you will still get redundant trailing blank characters(if not characters from an other display element), which is still inconvenient. I suggest writing copied content to a file, often SSH users can open multiple sessions to access such file without leaving the TUI interface. And writing to a file is trivial to implement.

  9. added a commit that references this issue on Apr 6, 2026
  10. bogorad commented on Apr 7, 2026

    @bogorad

    fyi:

    4712c18

  11. removed
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on May 3, 2026
  12. lee-b commented on Jun 4, 2026

    @lee-b

    Yes, we need the equivalent of vim's set mouse=, and tmux's : set -g mouse off.

  13. github-actions commented on Aug 4, 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. lee-b commented on Aug 4, 2026

    @lee-b

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

    :/

  15. jorpnes commented on Nov 13, 2026

    @jorpnes

    Comentario para los issues #6824 / #7926 (pedir opción de desactivar el mouse):


    +1 — affected on Windows 11 (build 10.0.26300), opencode 2.3.0, VS Code integrated terminal.

    While working normally, mouse-tracking data leaks into the TUI input as random text (bursts of digits and escape-like sequences, several times a day). Same family of reports as #8866 (;23M;26M;29M mouse reports typed into the input) and #8715.

    A tui: { mouse: false } option (or OPENCODE_DISABLE_MOUSE=true) would be an immediate, clean workaround until mouse reports are parsed properly on Windows. I checked https://opencode.ai/config.json on 2026-11-13 and neither key exists in the schema yet.

    Details and a full reproduction context in the new issue I opened: #63831


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