Skip to content

feat: optional terminal mouse taps, off by default#131

Merged
gwitko merged 1 commit into
gwitko:devfrom
dorokuma:feat/optional-terminal-mouse-taps
Jul 11, 2026
Merged

feat: optional terminal mouse taps, off by default#131
gwitko merged 1 commit into
gwitko:devfrom
dorokuma:feat/optional-terminal-mouse-taps

Conversation

@dorokuma

Copy link
Copy Markdown
Contributor

After the soft-keyboard fix for mouse-aware TUIs, tapping the terminal always opens the keyboard even when mouse tracking is on. That is what we want, but the tap is still forwarded as a mouse report (SGR, e.g. 0;col;rowM / 0;col;rowm).

When the remote side is a plain shell, or mouse tracking was left on after a TUI exited, those reports show up as garbage on the command line. Coordinates change with every tap, so it looks random.

Approach

Keep the always-show-keyboard behavior. Make sending mouse taps optional.

  • New Appearance → Terminal toggle: Send mouse taps
  • Subtitle: Forward terminal taps as mouse clicks when apps enable mouse tracking.
  • Default off so taps only focus the terminal / open the keyboard and do not inject mouse sequences
  • When on, same as today: taps are reported to mouse-aware apps (vim, htop, Bubble Tea, etc.)

Persisted with the other appearance prefs, included in backup/restore. Uses conduit_vt's existing PointerInputs / TerminalController.setPointerInputs so we only gate tap reporting; keyboard focus callbacks are unchanged.

Changes

  • lib/core/theme/theme_preferences_repository.dart — store terminalMouseInput (default false)
  • lib/core/theme/theme_controller.dart — load/save/toggle
  • lib/core/presentation/theme_sheet.dart — Appearance UI
  • lib/features/terminal/presentation/widgets/terminal_surface.dart — wire pointer inputs
  • lib/features/terminal/presentation/terminal_page.dart — pass preference into the surface
  • lib/features/backup/data/app_backup_service.dart — backup field
  • tests for default/persist and the Appearance toggle

Testing

  • Unit: theme prefs default off / persist on; Appearance sheet toggle; terminal surface still builds with the new flag
  • Device: with the toggle off, blank taps open the keyboard and no mouse garbage; with it on, mouse-aware TUI clicks work again

Keep always-show-keyboard on tap, but stop injecting mouse reports
unless the user opts in under Appearance → Terminal.
@gwitko

gwitko commented Jul 11, 2026

Copy link
Copy Markdown
Owner

Thanks!

@gwitko gwitko merged commit 427dd65 into gwitko:dev Jul 11, 2026
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.

2 participants