Skip to content

Conversation

@lhecker
Copy link
Member

@lhecker lhecker commented May 29, 2024

First, this makes use of PSEUDOCONSOLE_INHERIT_CURSOR to stop ConPTY from emitting a CSI 2 J on startup. Then, it uses Terminal::SetViewportPosition to fake-scroll the viewport down so that only 3 lines of scrollback are visible. It avoids printing actual newlines because if we later change the text buffer to actually track the written contents, we don't want those newlines to end up in the next buffer snapshot.

Closes #17274

Validation Steps Performed

  • Restore cmd multiple times
  • There's always exactly 3 lines visible ✅

@DHowett
Copy link
Member

DHowett commented May 29, 2024

Does this approach cause the display to snap down to the bottom when you type for the first time?

@lhecker
Copy link
Member Author

lhecker commented May 29, 2024

It will already be at the bottom when you open it:
image

If I scroll up and then type, it'll snap down to how it looks like in the screenshot.

@zadjii-msft zadjii-msft added this pull request to the merge queue May 30, 2024
Merged via the queue into main with commit bdc7c4f May 30, 2024
@zadjii-msft zadjii-msft deleted the dev/lhecker/17274-restore-scroll branch May 30, 2024 15:01
@lhecker lhecker added the Issue-Bug It either shouldn't be doing this or needs an investigation. label Nov 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Issue-Bug It either shouldn't be doing this or needs an investigation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Don't push the buffer contents into the scrollback on session restore

5 participants