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 745a88f2f6.

Fixes #2320.
This commit is contained in:
Fabian Homborg 2018-05-08 12:39:58 +02:00
parent 21890ccac7
commit e35d248f64

View file

@ -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(),