From e35d248f6408b6d6d9fbdeafa901a112a6d4e642 Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Tue, 8 May 2018 12:39:58 +0200 Subject: [PATCH] Fix clearing abandoned line with VTE (#4243) Turns out the segfaults we've been getting in our tests are because we set $TERM to "dumb". So we only clear the line if the terminal isn't dumb. This reverts commit 745a88f2f6119f28ed951be7711ec9774d59b683. Fixes #2320. --- src/screen.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/screen.cpp b/src/screen.cpp index 6e565dcf9..da5c2803d 100644 --- a/src/screen.cpp +++ b/src/screen.cpp @@ -1196,7 +1196,9 @@ 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"); + if (!is_dumb()) { + 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(),