From af843540a007f7f2ad542d262d7cd10bc3ba4614 Mon Sep 17 00:00:00 2001 From: Mariusz Glebocki Date: Sat, 15 Jun 2019 16:55:31 -0400 Subject: [PATCH] Konsole: CSI 2J: Do not append current screen to history MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: This behavior is present in e.g. xterm and linux console. Currently when using CSI 2J escape sequence, screen contents are appended to scrollback (including bottom empty lines). This is breaking `clear` command, which replaces scrollback with current screen contents. BUG: 384218 Test Plan: * Start Konsole with a shell * `clear` **Expected result:** Cleared display, empty scrollback. **Actual result:** Cleared display, but scrollback contains previous display contents. --- * Start Konsole with a shell * seq 1000 * `echo -ne '\033[2J` **Expected result:** Cleared display, numbers in last scrollback lines. **Actual result:** Cleared display, but scrollback contains previous display contents (i.e. shell prompt in last lines) Reviewers: #konsole, hindenburg Reviewed By: #konsole, hindenburg Subscribers: hindenburg, konsole-devel, #konsole Tags: #konsole Differential Revision: https://phabricator.kde.org/D21282 Taken from KDE patches and adapted to TDE. Signed-off-by: Slávek Banko (cherry picked from commit 838025df1cdfed31cfb086329cbf090b79d33159) --- konsole/konsole/TEScreen.cpp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/konsole/konsole/TEScreen.cpp b/konsole/konsole/TEScreen.cpp index d1d7985a5..d3209b65c 100644 --- a/konsole/konsole/TEScreen.cpp +++ b/konsole/konsole/TEScreen.cpp @@ -1036,12 +1036,6 @@ void TEScreen::clearToBeginOfScreen() void TEScreen::clearEntireScreen() { - // Add entire screen to history - for (int i = 0; i < (lines-1); i++) - { - addHistLine(); scrollUp(0,1); - } - clearImage(loc(0,0),loc(columns-1,lines-1),' '); }