opencode icon indicating copy to clipboard operation
opencode copied to clipboard

feat(tui): add disable_mouse option for Linux right-click paste support

Open aarongrtech opened this issue 3 weeks ago • 0 comments

Summary

Adds a --disable-mouse CLI flag and tui.disable_mouse config option to allow users to disable mouse tracking, enabling native terminal right-click paste functionality on Linux terminals that use PuTTY-style paste (e.g., Terminator).

Fixes #4754

Changes

  • Added disable_mouse: boolean to TUI config schema (config.ts)
  • Added --disable-mouse CLI flag to both thread.ts and attach.ts commands
  • Implemented mouse tracking disable logic in app.tsx using ANSI escape sequences

Usage

CLI flag:

opencode --disable-mouse

Config file (opencode.json):

{
  "tui": {
    "disable_mouse": true
  }
}

Technical Details

When enabled, sends ANSI escape sequences to disable all mouse tracking modes:

  • \x1b[?1000l - Disable button press/release tracking
  • \x1b[?1002l - Disable button motion tracking
  • \x1b[?1003l - Disable all motion tracking
  • \x1b[?1006l - Disable SGR extended mouse mode

This allows the terminal's native right-click paste behavior to work instead of being intercepted by opentui.

aarongrtech avatar Dec 29 '25 01:12 aarongrtech