You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(terminal): prevent bursts of TUI mouse wheel reports - #1500
A fast or inertial wheel event can send ten mouse notches to an application. Each notch can scroll several rows in the TUI, which multiplies the movement.
Limit mouse tracking to one notch per event. Small trackpad deltas still accumulate, and whole excess notches are discarded. Normal scrollback, scroll speed scaling and DEC 1007 cursor key scrolling retain their existing behavior.
Four regression cases fail on main and pass with the fix. The full frontend suite, lint, production build, startup graph and size budgets passed. Native macOS trackpad behavior still needs a manual check.
No actionable comments were generated in the recent review.
Walkthrough
Wheel input now uses a one-report-per-event limit for mouse reporting and a separate ten-key limit for alternate scrolling. TerminalMouse.wheel sends a single report when the pointer position is valid.
Changes: Terminal wheel input
Layer / File(s)
Summary
Route-specific wheel limits and report emission src/modules/terminal/ghostty/input/terminalWheel.ts, src/modules/terminal/ghostty/input/GhosttyInputController.ts, src/modules/terminal/ghostty/input/TerminalMouse.ts, src/modules/terminal/ghostty/input/GhosttyInputController.test.ts
The controller limits mouse-report routes to one report per event and retains a ten-key limit for alternate scrolling. TerminalMouse.wheel sends one report for a valid pointer position. Tests cover delta accumulation, discarded excess motion, and alternate-scroll bursts.
Issue 1498 reports excessive terminal scroll speed on macOS, which overlaps with this change’s wheel-report limit.
Issue 1364 reports high terminal scroll speed in Claude Code on macOS, which overlaps with this change’s wheel-report limit.
Possibly related PRs
crynta/terax-ai#1408: Changes mouse-report wheel input and trackpad delta accumulation in the same controller path.
Merge Risk: Minimal · up to b0c89
Mouse wheel reports in terminal apps are now limited to one per event, and the change is small and easy to revert. Native trackpad behavior still needs manual verification, but no merge-blocking risk is identified.
Pre-merge checks: 4
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title "fix(terminal): prevent bursts of TUI mouse wheel reports" follows Conventional Commits (type fix, scope terminal). It matches the main change: the wheel handling now sends one wheel report …
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title "fix(terminal): prevent bursts of TUI mouse wheel reports" follows Conventional Commits (type fix, scope terminal). It matches the main change: the wheel handling now sends one wheel report per fast event and drops excess whole notches, which stops bursts of TUI mouse wheel reports. The title is descriptive and fits the changeset and PR objectives.
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A fast or inertial wheel event can send ten mouse notches to an application. Each notch can scroll several rows in the TUI, which multiplies the movement.
Limit mouse tracking to one notch per event. Small trackpad deltas still accumulate, and whole excess notches are discarded. Normal scrollback, scroll speed scaling and DEC 1007 cursor key scrolling retain their existing behavior.
Four regression cases fail on main and pass with the fix. The full frontend suite, lint, production build, startup graph and size budgets passed. Native macOS trackpad behavior still needs a manual check.
Refs #1498 and #1364.
Summary by CodeRabbit