-
Notifications
You must be signed in to change notification settings - Fork 9.1k
Description
Environment
Windows build number: Version 10.0.18362.356
Also tested with a recent build from source: 171f00c
Steps to reproduce
- Start a WSL bash shell in conhost.
- Do a long directory listing so you get some content in the backscroll buffer.
- Execute this command:
printf "\e[?1049h\e[3J\e[?1049l"
That command switches to the alternate buffer (private mode 1049), executes the ED escape sequence with parameter 3 (i.e. erase the scrollback buffer), and then switches back to the main buffer.
Expected behavior
The alternate screen buffer doesn't have a scrollback, so the ED3 sequence should erase the main scrollback buffer. Then when you switch back to the main screen, there should be no scrollback any more.
This is how the command is implemented in XTerm, and most of the other terminal emulators I've tested.
Actual behavior
The main scrollback buffer isn't erased.
This is probably somewhat related to issue #3545. I think the alt screen technically has its own scrollback (even though it's zero length), and it's that empty buffer that is being "erased" when ED3 is executed. It might be better if the alt screen shared the same buffer as the main screen.