[PR #6329] feat(tui): add disable_mouse option for Linux right-click paste support #11840

Open
opened 2026-02-16 18:16:46 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/6329

State: open
Merged: No


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.

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/6329 **State:** open **Merged:** No --- ## 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:** ```bash opencode --disable-mouse ``` **Config file (opencode.json):** ```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.
yindo added the pull-request label 2026-02-16 18:16:46 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#11840