From 61069543e01583644467df16e50f6708622aba31 Mon Sep 17 00:00:00 2001 From: Mariusz Glebocki Date: Tue, 3 Apr 2018 15:33:05 -0400 Subject: [PATCH] Do not resize new screen lines MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: The lines are resized when something is put in them. Resizing them here filled them with spaces (default value), later those trailing spaces were put into history, and eventually into saved output or clipboard (because it is assumed lines in history do not contain trailing spaces). BUG: 392419 Test Plan: * Enable "Trim trailing spaces" in Profile Settings → Mouse * Set window size to about 100x100px * Clear terminal (Ctrl-Shift-K by default) * Run: ``` seq $(( $(tput lines) * 2 )); \ printf '*** resize ***'; read -s; printf '\n'; \ seq $(( $(tput lines) * 2 )) ``` * When "resize" show up, resize the window to about 500x500px * Press enter * Select and copy lines below `*** resize ***` * Paste it in a text editor which allows to show trailing spaces Expected result: lines should not contain trailing spaces Actual result: lines added when resizing the window have trailing spaces Reviewers: #konsole, hindenburg Reviewed By: #konsole, hindenburg Subscribers: #konsole Tags: #konsole Differential Revision: https://phabricator.kde.org/D11893 --- src/Screen.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/Screen.cpp b/src/Screen.cpp index 30547e3b..e5ae622e 100644 --- a/src/Screen.cpp +++ b/src/Screen.cpp @@ -366,9 +366,6 @@ void Screen::resizeImage(int new_lines, int new_columns) for (int i = 0; i < qMin(_lines, new_lines + 1) ; i++) { newScreenLines[i] = _screenLines[i]; } - for (int i = _lines; (i > 0) && (i < new_lines + 1); i++) { - newScreenLines[i].resize(new_columns); - } _lineProperties.resize(new_lines + 1); for (int i = _lines; (i > 0) && (i < new_lines + 1); i++) {