Skip to content

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

@LEON-gittech

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

Metadata

Metadata

Assignees

Labels

opentuiThis relates to changes in v1.0, now that opencode uses opentui

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions