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

Open
opened 2026-02-16 17:45:33 -05:00 by yindo · 3 comments
Owner

Originally created by @LEON-gittech on GitHub (Jan 12, 2026).

Originally assigned to: @kommander on GitHub.

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
Originally created by @LEON-gittech on GitHub (Jan 12, 2026). Originally assigned to: @kommander on GitHub. ## 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: ```json // opencode.json { "tui": { "mouse": false } } ``` Or via environment variable: ```bash 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
yindo added the opentui label 2026-02-16 17:45:33 -05:00
Author
Owner

@wwalker commented on GitHub (Jan 14, 2026):

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

Environment:

  • tmux
  • XTerm
  • Fedora Linux and Ubuntu Linux
  • OpenCode version: latest
@wwalker commented on GitHub (Jan 14, 2026): +1, this issue makes `opencode` almost completely unusable for me. ## Environment: * tmux * XTerm * Fedora Linux and Ubuntu Linux * OpenCode version: latest
Author
Owner

@onyedikachi23 commented on GitHub (Feb 2, 2026):

I need this, pls.

@onyedikachi23 commented on GitHub (Feb 2, 2026): I need this, pls.
Author
Owner

@VRuzhentsov commented on GitHub (Feb 12, 2026):

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".

@VRuzhentsov commented on GitHub (Feb 12, 2026): 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".
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#4813