Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
lhecker opened this issue Apr 5, 2024 · 1 comment
Labels
Area-Output Related to output processing (inserting text into buffer, retrieving buffer text, etc.) Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-2 A description (P2) Product-Terminal The new Windows Terminal.
Milestone

Comments

@lhecker
Copy link
Member

lhecker commented 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:

_virtualBottom = std::max({ lastNonSpaceRow, estimatedBottom, viewportBottom });
// We can't let it extend past the bottom of the buffer either.
_virtualBottom = std::min(_virtualBottom, newTextBuffer->GetSize().BottomInclusive());

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.

@lhecker lhecker added Area-Output Related to output processing (inserting text into buffer, retrieving buffer text, etc.) Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Product-Terminal The new Windows Terminal. labels Apr 5, 2024
@zadjii-msft

This comment was marked as off-topic.

@carlos-zamora carlos-zamora added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Priority-2 A description (P2) and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Apr 10, 2024
@carlos-zamora carlos-zamora added this to the Backlog milestone Apr 10, 2024
@carlos-zamora carlos-zamora removed the Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting label Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Output Related to output processing (inserting text into buffer, retrieving buffer text, etc.) Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-2 A description (P2) Product-Terminal The new Windows Terminal.
Projects
None yet
Development

No branches or pull requests

3 participants