Skip to content

Fix fractional wheel scrolling in scrollback and alternate screen#811

Open
jerezereh wants to merge 3 commits into
pop-os:masterfrom
jerezereh:wheel-scroll-fixes
Open

Fix fractional wheel scrolling in scrollback and alternate screen#811
jerezereh wants to merge 3 commits into
pop-os:masterfrom
jerezereh:wheel-scroll-fixes

Conversation

@jerezereh
Copy link
Copy Markdown

Addresses issues #781 (commit 30738db) and #385 (commit 0468347).

Wheel scrolling previously cast float inputs to ints, dropping all fractional scrolling that occurs on most modern, high-resolution scroll wheels. Commit 30738db addresses this by keeping scroll delta as float, and saving remainders to state.

Additionally noticed while testing that scroll events were not received in ALT_SCREEN mode (less, vi, man, etc.). Fixes in commit 0468347 address this by allowing non-SGR mouse mode wheel events, sending mouse wheel or arrow key events depending on TermMode::APP_CURSOR, and saving the fractional mouse wheel events (as in the previous commit).

Tests have been added to both terminal_box.rs and mouse_reporter.rs.


  • I have disclosed use of any AI generated code in my commit messages.
    • If you are using an LLM, and do not fully understand the changes it is making to the code base, do not create a PR.
    • In our experience, AI generated code often results in overly complex code that lacks enough context for a proper fix or feature inclusion. This results in considerably longer code reviews. Due to this, AI authored or partially authored PRs may be closed without comment.
  • I understand these changes in full and will be able to respond to review comments.
  • My change is accurately described in the commit message.
  • My contribution is tested and working as described.
  • I have read the Developer Certificate of Origin and certify my contribution under its conditions.

Disclaimer: As I am new to Rust, AI agent Codex was used for reference and to review code. If any changes here don't look right, I would be happy to receive feedback or guidance.

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