[PR #17334] Show parts of the scrollback on restore #31196

Open
opened 2026-01-31 09:45:44 +00:00 by claunia · 0 comments
Owner

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

State: closed
Merged: Yes


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
**Original Pull Request:** https://github.com/microsoft/terminal/pull/17334 **State:** closed **Merged:** Yes --- 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 ✅
claunia added the pull-request label 2026-01-31 09:45:44 +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#31196