Skip to content

Let a laptop trackpad scroll the terminal - #32

Merged
bharathm03 merged 1 commit into
developmentfrom
fix/trackpad-scroll-pin
Aug 27, 2026
Merged

Let a laptop trackpad scroll the terminal#32
bharathm03 merged 1 commit into
developmentfrom
fix/trackpad-scroll-pin

Conversation

@bharathm03

Copy link
Copy Markdown
Contributor

Two-finger scroll does nothing in the terminal on a laptop. The fix is entirely in the fork — this bumps the pin to c262d5f (antgrid-ai/dart_terminal master with #8 merged).

Two independent paths dropped precision scrolling, and a trackpad hits both, which is why nothing about the gesture worked in either direction at any speed:

  • The wheel path rounded the remainder away. (scrollDelta.dy / linePixels).round(), remainder discarded. A mouse notch is worth several lines and survives; a precision touchpad reports a few pixels per event, every one rounds to zero, and the transcript never moves however long you scroll.
  • The pan-zoom path was dropped whenever the program had the mouse. PointerPanZoom* is what a two-finger scroll actually delivers (macOS always, Windows precision touchpads via DirectManipulation), and a full-screen agent holds mouse reporting for its entire run — so the only scroll input a laptop has was dead for the whole session. It now forwards one wheel step per line crossed, reusing the same _sendWheelStep the real wheel uses.

Fork side carries two new tests, both failing before that change: a trackpad pan under normalMouse + sgrMouse reaches the program as BUTTON_FOUR, and quarter-line wheel deltas still scroll.

Gates

flutter analyze lib test — No issues found. flutter test — 2639 pass. npm run check:font-tokens — OK. Fork package on the merged commit: 214 pass, 28 fail, the same 28 that fail on its master on this machine (POSIX-shell and glyph-metric cases).

Not verified on hardware

The fork's repros are synthetic pointer sequences, so they prove the code path, not the platform — which of the two bugs was the one biting on the reporting laptop is still unmeasured, and neither fix has been driven by a real trackpad yet.

Picks up antgrid-ai/dart_terminal#8. Two independent paths in the terminal view dropped precision scrolling, and a two-finger scroll hits both: the wheel path rounded each event to whole lines and discarded the remainder (a mouse notch survives that, a touchpad's few-pixel events all round to zero), and the pan-zoom path — what a trackpad actually delivers — returned early whenever the program had mouse reporting on, which a full-screen agent holds for its entire run.
@bharathm03
bharathm03 merged commit 5ec1ac6 into development Aug 27, 2026
4 checks passed
@bharathm03
bharathm03 deleted the fix/trackpad-scroll-pin branch August 27, 2026 16:42
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