Clear screen also clears attributes/xterm modes (#911)

Clear was setting characters to a space using the current style,
but if the style left Dim/Bold/Inverse (etc) enabled, that was being
used to affect the clear character, and thus affected clearing screen.

Seems weird tho; what if one wants to do a cleol (\033[K) on a screen
that is all inverted text; is there no way to use inverse mode for
clearing to the end of line? Or to delete a character?
This commit is contained in:
Greg Ercolano 2024-02-16 22:59:56 -08:00
parent 3ecadc0a8e
commit eb4916344b
1 changed files with 1 additions and 1 deletions

View File

@ -553,7 +553,7 @@ protected:
double pwidth(void) const;
int pwidth_int(void) const;
// Clear the character to a 'space'
void clear(const CharStyle& style) { text_ascii(' ', style); }
void clear(const CharStyle& style) { text_utf8(" ", 1, style); charflags_ = 0; attrib_ = 0; }
bool is_char(char c) const { return *text_ == c; }
void show_char(void) const { ::printf("%.*s", len_, text_); }
void show_char_info(void) const { ::fprintf(stderr, "UTF-8('%.*s', len=%d)\n", len_, text_, len_); }