[PR #16334] Fix scrolling with SetConsoleWindowInfo #30901

Closed
opened 2026-01-31 09:43:42 +00:00 by claunia · 0 comments
Owner

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

State: closed
Merged: Yes


81b7e54 caused a regression in SetConsoleWindowInfo and any other
function that used the WriteToScreen helper. This is because it
assumes that it can place the viewport anywhere randomly and it was
written at a time where TriggerScroll didn't exist yet (there was
no need for that (also not today, but that's being worked on)).

Caching the viewport meant that WriteToScreen's call to
TriggerRedraw would pick up the viewport from the last rendered
frame, which would cause the intersection of both to be potentially
empty and nothing to be drawn on the screen.

This commit reverts 81b7e54 as I found that it has no or negligible
impact on performance at this point, likely due to the overall
vastly better performance of conhost nowadays.

Closes #15932

Validation Steps Performed

**Original Pull Request:** https://github.com/microsoft/terminal/pull/16334 **State:** closed **Merged:** Yes --- 81b7e54 caused a regression in `SetConsoleWindowInfo` and any other function that used the `WriteToScreen` helper. This is because it assumes that it can place the viewport anywhere randomly and it was written at a time where `TriggerScroll` didn't exist yet (there was no need for that (also not today, but that's being worked on)). Caching the viewport meant that `WriteToScreen`'s call to `TriggerRedraw` would pick up the viewport from the last rendered frame, which would cause the intersection of both to be potentially empty and nothing to be drawn on the screen. This commit reverts 81b7e54 as I found that it has no or negligible impact on performance at this point, likely due to the overall vastly better performance of conhost nowadays. Closes #15932 ## Validation Steps Performed * Scroll the viewport by entire pages worth of content using `SetConsoleWindowInfo` - see #15932 * The screen and scrollbars update immediately ✅
claunia added the pull-request label 2026-01-31 09:43:42 +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#30901