From 09cb31a172773761a305f7353b44e9bb056a5d98 Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Thu, 10 Aug 2017 00:37:32 +0200 Subject: [PATCH] Fix clearing abandoned line with VTE (#4243) * Fix clearing abandoned line with VTE With VTE-based terminals, resizing currently causes multi-line prompts to go weird. This changes the sequence we use to clear the line to one suggested by a VTE developer (https://bugzilla.gnome.org/show_bug.cgi?id=763390#c4). It changes nothing in konsole 17.04.3 and urxvt 9.22, but they already work. Note that this does not fix the case where output did not end in a newline, but that doesn't seem to be up to us. Also, it only affects those lines. Fixes #2320. * Use terminfo definition instead of hardcoding Thanks to @ixjlyons. --- src/screen.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/screen.cpp b/src/screen.cpp index 0d0d3cc1d..7a07d21c5 100644 --- a/src/screen.cpp +++ b/src/screen.cpp @@ -1287,7 +1287,7 @@ void s_reset(screen_t *s, screen_reset_mode_t mode) { // line above your prompt. This doesn't make a difference in normal usage, but copying and // pasting your terminal log becomes a pain. This commit clears that line, making it an // actual empty line. - abandon_line_string.append(L"\e[2K"); + abandon_line_string.append(str2wcstring(clr_eol)); const std::string narrow_abandon_line_string = wcs2string(abandon_line_string); write_loop(STDOUT_FILENO, narrow_abandon_line_string.c_str(),