opencode
opencode copied to clipboard
feat(tui): add disable_mouse option for Linux right-click paste support
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: booleanto TUI config schema (config.ts) - Added
--disable-mouseCLI flag to boththread.tsandattach.tscommands - Implemented mouse tracking disable logic in
app.tsxusing 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.