From eb4916344b7cd92ac1a4aa862976808c96dbfcde Mon Sep 17 00:00:00 2001 From: Greg Ercolano Date: Fri, 16 Feb 2024 22:59:56 -0800 Subject: [PATCH] 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? --- FL/Fl_Terminal.H | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FL/Fl_Terminal.H b/FL/Fl_Terminal.H index 09673f557..1a63fdaa7 100644 --- a/FL/Fl_Terminal.H +++ b/FL/Fl_Terminal.H @@ -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_); }