RIS in the alt buffer should switch to the main buffer #5156

Closed
opened 2026-01-31 00:06:25 +00:00 by claunia · 1 comment
Owner

Originally created by @j4james on GitHub (Nov 24, 2019).

Environment

Windows build number: Version 10.0.18362.356
Also tested with a recent build from source: 171f00c265

Steps to reproduce

  1. Start a WSL bash shell in conhost.
  2. Do a directory listing or anything that produces some output.
  3. Execute this command: printf "\e[?1049h\ec\e[?1049l"

That command switches to the alternate buffer (private mode 1049), executes the RIS escape sequence (reset to initial state), and then switches back to the main buffer.

Expected behavior

The RIS command should automatically switch back to the main buffer, and then clear the main buffer's screen. The final 1049 sequence isn't relevent at that point, since we are already back in the main buffer. The end result should be a blank screen, other than the shell prompt.

I don't think this behaviour is actually documented anywhere, but that's the way it works in XTerm, and most of the other terminal emulators I've tested.

Actual behavior

The RIS command clears the alternate buffer, and doesn't switch back to the main buffer. So when the final 1049 sequence does switch back, the main buffer contents are all still visible.

Originally created by @j4james on GitHub (Nov 24, 2019). # Environment Windows build number: Version 10.0.18362.356 Also tested with a recent build from source: 171f00c2656731e5ba0185dbbf337389fb7030bd # Steps to reproduce 1. Start a WSL bash shell in conhost. 2. Do a directory listing or anything that produces some output. 3. Execute this command: `printf "\e[?1049h\ec\e[?1049l"` That command switches to the alternate buffer (private mode 1049), executes the [`RIS`](https://vt100.net/docs/vt510-rm/RIS.html) escape sequence (reset to initial state), and then switches back to the main buffer. # Expected behavior The `RIS` command should automatically switch back to the main buffer, and then clear the main buffer's screen. The final 1049 sequence isn't relevent at that point, since we are already back in the main buffer. The end result should be a blank screen, other than the shell prompt. I don't think this behaviour is actually documented anywhere, but that's the way it works in XTerm, and most of the other terminal emulators I've tested. # Actual behavior The `RIS` command clears the alternate buffer, and doesn't switch back to the main buffer. So when the final 1049 sequence does switch back, the main buffer contents are all still visible.
Author
Owner

@ghost commented on GitHub (Apr 22, 2020):

:tada:This issue was addressed in #5248, which has now been successfully released as Windows Terminal Preview v0.11.1121.0.🎉

Handy links:

@ghost commented on GitHub (Apr 22, 2020): :tada:This issue was addressed in #5248, which has now been successfully released as `Windows Terminal Preview v0.11.1121.0`.:tada: Handy links: * [Release Notes](https://github.com/microsoft/terminal/releases/tag/v0.11.1121.0) * [Store Download](https://www.microsoft.com/store/apps/9n0dx20hk701?cid=storebadge&ocid=badge)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#5156