Skip to content

feat(scroll): add opt-in smooth pixel scrolling#1599

Draft
nmb4 wants to merge 1 commit into
raphamorim:mainfrom
nmb4:smooth-scrolling
Draft

feat(scroll): add opt-in smooth pixel scrolling#1599
nmb4 wants to merge 1 commit into
raphamorim:mainfrom
nmb4:smooth-scrolling

Conversation

@nmb4
Copy link
Copy Markdown

@nmb4 nmb4 commented May 15, 2026

Summary

  • Adds an opt-in scroll.smooth setting for pixel-level trackpad scrolling while keeping the existing line-based behavior as the default.
  • Carries fractional scroll offset through the terminal renderer and grid shaders so scroll movement can render between row boundaries.
  • Fetches an extra visible row during smooth scrolling to avoid gaps, resets smooth offset on jump-style scroll commands, and clamps offset at scrollback boundaries.

Validation

  • cargo fmt --check

Add an opt-in smooth scrolling path that accumulates trackpad pixel deltas, carries fractional scroll offset through the renderer, and shifts the grid shader origin for sub-line motion.

Fetch an extra visible row while smooth scrolling so partially exposed history content can render without gaps, and reset the fractional offset for jump-style scroll commands and bottom snaps.

Clamp the fractional offset at scrollback boundaries and expose the behavior through the scroll.smooth config option, disabled by default.
@nmb4
Copy link
Copy Markdown
Author

nmb4 commented May 15, 2026

Disclaimer: fully AI (GLM 5.1 via claude code, for transparency).
like i didn't touch one line of code for this, i was surprised myself when it just worked. it's not perfect, theres a bug that causes split panes of the same tab to all pixel-scroll at the same time, but i'll have it fixed asap. it's disabled by default, set mouse.smooth = true in the config to enable it. but man it feels good. especially on macos using the trackpad, mabye i can make mouse scrolling feel better as well next.

@nmb4
Copy link
Copy Markdown
Author

nmb4 commented May 16, 2026

Screen.Recording.2026-05-16.at.12.59.47.mov

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