Conversation
Erase in display (CSI 2 J) now moves what is on the screen into the history before erasing it, as Windows Terminal and VTE do, instead of destroying it. Blank lines at the bottom of the screen are left out, and the cursor does not move. Where the buffer cannot grow, the oldest lines make way; on a buffer capped at the screen height nothing is kept, as before. This matters most on Windows: ConPTY starts every connection with CSI 2 J CSI H, so reconnecting a terminal erased as many lines of the previous session as the screen was high, and a program that clears the screen took the user's last screen of output with it. CSI 3 J still clears the history, so "clear" empties everything as it did.
The change to erasing alters the bundle's content, and the build compares it against the 4.41 release, where 1.1.200 already exists.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Erase in display (CSI 2 J) destroyed what was on the screen. It now moves it into the history first, the way Windows Terminal and VTE handle it, and then erases.
Why it matters. On Windows the local terminal runs through ConPTY, and ConPTY starts every connection with CSI 2 J followed by CSI H. Reconnecting a terminal therefore erased as many lines of the previous session as the screen was high: after
seq 1 200in a 31-line terminal, a reconnect kept only 1 to 171. The same happens whenever a program clears the screen, taking the user's last screen of output with it. This was captured from a real ConPTY session (wsl.exe) and replayed through the emulator; the loss is the same on current master.Details:
clear(CSI H CSI 2 J CSI 3 J) empties everything as before.xterm itself erases without keeping the screen; this follows the terminals most users on Windows and Linux compare Eclipse's terminal with.
Tests: testEraseAll now expects the screen in the history; testEraseAllKeepsTheScreenInHistory covers the blank lines at the bottom and the cursor, on both TerminalTextDataStore and TerminalTextData; testClearScreenKeepsItInHistory runs the sequence ConPTY sends through the emulator. All three fail without the change.