[PR #15262] Fix Present1 params when scrolling the entire viewport #30554

Open
opened 2026-01-31 09:41:31 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/microsoft/terminal/pull/15262

State: closed
Merged: Yes


This commit makes a few changes to avoid bugs, but they basically boil
down to: When we scroll by an entire viewport worth of content, we must
ensure that the scroll offset is 0, because otherwise the scroll rect
(that's basically the viewport, but excluding the scroll offset) will
end up being empty, which the Present1 API chokes on. This commit
avoids this situation by shuffling around some code to first calculate
the dirty rows, then check if it affects all of them and in that case
sets the scroll offset to 0, and only then finally actually does any
scrolling if there's still something to scroll.

Validation Steps Performed

  • Start pwsh
  • Zoom in twice with Ctrl+Scrollwheel
  • Print a few viewports worth of text
  • Press Ctrl+L
  • No errors
**Original Pull Request:** https://github.com/microsoft/terminal/pull/15262 **State:** closed **Merged:** Yes --- This commit makes a few changes to avoid bugs, but they basically boil down to: When we scroll by an entire viewport worth of content, we must ensure that the scroll offset is 0, because otherwise the scroll rect (that's basically the viewport, but excluding the scroll offset) will end up being empty, which the `Present1` API chokes on. This commit avoids this situation by shuffling around some code to first calculate the dirty rows, _then_ check if it affects all of them and in that case sets the scroll offset to 0, and only then finally actually does any scrolling if there's still something to scroll. ## Validation Steps Performed * Start pwsh * Zoom in twice with Ctrl+Scrollwheel * Print a few viewports worth of text * Press Ctrl+L * No errors ✅
claunia added the pull-request label 2026-01-31 09:41:31 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#30554