ResizeWithReflow doesn't clamp _virtualBottom if the cursor is above the viewport #21494

Open
opened 2026-01-31 07:46:17 +00:00 by claunia · 1 comment
Owner

Originally created by @lhecker on GitHub (Apr 5, 2024).

Windows Terminal version

1a6ba43

Windows build number

No response

Other Software

No response

Steps to reproduce

TBA: Exact steps unclear, but it was found by @zadjii-msft in #16937 as part of reflow tests.
However, repro steps aren't quite necessary as the flaw can be clearly seen here:
1a6ba43dd2/src/host/screenInfo.cpp (L1404-L1407)

There's no min(). (Alternatively, you can just patch Reflow() to put the cursor at 0,0 after a reflow.)

Terminal::UserResize doesn't use its newCursorPos either.

Expected Behavior

No response

Actual Behavior

The viewport should always contain the cursor, even if the cursor is above the viewport.

Originally created by @lhecker on GitHub (Apr 5, 2024). ### Windows Terminal version 1a6ba43 ### Windows build number _No response_ ### Other Software _No response_ ### Steps to reproduce TBA: Exact steps unclear, but it was found by @zadjii-msft in #16937 as part of reflow tests. However, repro steps aren't quite necessary as the flaw can be clearly seen here: https://github.com/microsoft/terminal/blob/1a6ba43dd220d4a318627006bf2a6c8b9a70c7bc/src/host/screenInfo.cpp#L1404-L1407 There's no `min()`. (Alternatively, you can just patch `Reflow()` to put the cursor at 0,0 after a reflow.) `Terminal::UserResize` doesn't use its `newCursorPos` either. ### Expected Behavior _No response_ ### Actual Behavior The viewport should always contain the cursor, even if the cursor is above the viewport.
claunia added the Area-OutputIssue-BugProduct-TerminalPriority-2 labels 2026-01-31 07:46:17 +00:00
Author
Owner

@zadjii-msft commented on GitHub (Apr 5, 2024):

ignore me i can't read

@zadjii-msft commented on GitHub (Apr 5, 2024): ignore me i can't read
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#21494