Skip to content

Conversation

@aarongrtech
Copy link

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.

Add --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 like Terminator that use PuTTY-style paste.

When enabled, sends ANSI escape sequences to disable all mouse tracking modes:
- Button press/release tracking (1000)
- Button motion tracking (1002)
- All motion tracking (1003)
- SGR extended mouse mode (1006)

Fixes sst#4754
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Copy and Paste behaviour under Linux

1 participant