opencode icon indicating copy to clipboard operation
opencode copied to clipboard

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

Open LEON-gittech opened this issue 4 days ago • 1 comments

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

LEON-gittech avatar Jan 12 '26 06:01 LEON-gittech