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

Show parts of the scrollback on restore #17334

Merged
merged 1 commit into from
May 30, 2024

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
20 checks passed
@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
4 participants