Repository navigation
feat(client): pixel-smooth scrollback scrolling - #47
Merged
Merged
Conversation
added 4 commits
October 12, 2026 20:53
Keep the scroll position as fractional lines: ghostty-web renders the whole lines, the fraction becomes a device-pixel CSS offset on the canvas plus a one-row strip for the line sliding in above it. Normal screen only. See ADR 040.
Pixel wheel deltas send one SGR scroll tick per cell height scrolled (times mouseScrollSpeed) instead of one per event, so trackpad scrolling in herdr, Claude Code and vim tracks the fingers. See ADR 040.
mouseScrollSpeed no longer multiplies pixel wheel deltas, so trackpad scrolling in herdr and Claude Code moves one line per cell height of travel, like native macOS scrolling and Ghostty's precision scrolling. It still scales line/page wheel deltas. See ADR 040.
jesse23
force-pushed
the
feat/client-smooth-scroll
branch
from
October 13, 2026 00:54
f5f484f to
eeaad03
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Trackpad scrolling stepped a whole line at a time behind a 100 ms easing animation, and in mouse-tracking apps it ran far ahead of the fingers.
Scrollback (normal screen, no mouse tracking). ghostty-web's viewport is whole lines only.
src/client/smooth-scroll.tskeeps the scroll position as fractional lines and takes over wheel events:viewportY(scrollToLine), rendered as usual.renderLine(renderer context swapped for the strip's), so it matches the canvas.Mouse-tracking apps (herdr, Claude Code fullscreen, vim
mouse=a). These scroll their own view in whole lines, so no pixel offset is possible. The SGR wheel handler sent at least one tick per wheel event, and a trackpad fires many small events plus momentum. Pixel deltas now count by distance: one tick per cell height scrolled, 1:1 with the OS like native macOS scrolling.mouseScrollSpeedno longer applies to pixel deltas (Ghostty likewise skips its multiplier for precision scrolls); it still scales line/page deltas.Builds on #46 (uses its whole-ratio renderer DPR for the strip).
Verification
bun run buildbun test(441 passed, including the newsmooth-scroll.test.ts)bun run lintlesson the alternate screen is unaffected.cat -vwith modes 1002/1006): 20 × 2px wheel events sent 4 SGR ticks with distance counting andmouseScrollSpeed: 1.5(14px cells), instead of 20. With the multiplier dropped for pixel deltas, the same input gives 2 (not re-measured in the browser).mouseScrollSpeedfor pixel deltas.ADRs