Skip to content

fix: forward wheel events with coordinates when mouse tracking is active#136

Open
dgageot wants to merge 1 commit intocoder:mainfrom
dgageot:wheelmouse
Open

fix: forward wheel events with coordinates when mouse tracking is active#136
dgageot wants to merge 1 commit intocoder:mainfrom
dgageot:wheelmouse

Conversation

@dgageot
Copy link

@dgageot dgageot commented Mar 10, 2026

When a TUI application enables mouse tracking (modes 1000/1002/1003), wheel events were being intercepted by the Terminal-level capture handler and converted to arrow key sequences, losing the mouse position. This meant applications like tmux or vim with split panes could not determine which zone the cursor was over, causing the wrong pane to scroll.

Now, when mouse tracking is active, Terminal forwards wheel events to InputHandler.handleWheelEvent() which sends proper SGR/X10 mouse sequences with cell coordinates (button 64/65 for scroll up/down).

Assisted-By: docker-agent

When a TUI application enables mouse tracking (modes 1000/1002/1003),
wheel events were being intercepted by the Terminal-level capture handler
and converted to arrow key sequences, losing the mouse position. This
meant applications like tmux or vim with split panes could not determine
which zone the cursor was over, causing the wrong pane to scroll.

Now, when mouse tracking is active, Terminal forwards wheel events to
InputHandler.handleWheelEvent() which sends proper SGR/X10 mouse
sequences with cell coordinates (button 64/65 for scroll up/down).

Assisted-By: docker-agent
dgageot added a commit to dgageot/board that referenced this pull request Mar 10, 2026
Switch terminal emulator from @xterm/xterm to ghostty-web (WASM-based
Ghostty port) loaded via ES module importmap from jsDelivr CDN.

Include a workaround for coder/ghostty-web#136: forward wheel events
with cell coordinates when mouse tracking is active, so scrolling in
tmux panes and other multi-region TUIs works correctly.

Assisted-By: docker-agent
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.

1 participant