Commit: 45b191c7557c2a3ef482237523d14450b40dd706
Parent: bf227f82582d6ca14931ba76b352dd6f0f4d9e18
Author: Randy Palamar
Date: Sat, 16 Nov 2024 18:20:09 -0700
only reset charsets when the terminal resets
Despite the fact that the charset table should be saved with the
cursor it should not be reset with the cursor. nvtop expects this
behaviour.
Diffstat:
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/terminal.c b/terminal.c
@@ -289,10 +289,6 @@ cursor_reset(Term *t)
t->cursor.style.fg = g_colours.data[g_colours.fgidx];
t->cursor.style.bg = g_colours.data[g_colours.bgidx];
t->cursor.style.attr = ATTR_NULL;
-
- t->cursor.charset_index = 0;
- for (u32 i = 0; i < ARRAY_COUNT(t->cursor.charsets); i++)
- t->cursor.charsets[i] = CS_USA;
}
static void
@@ -398,6 +394,9 @@ term_reset(Term *t)
t->cursor.state = CURSOR_NORMAL;
for (u32 i = 0; i < ARRAY_COUNT(t->saved_cursors); i++) {
cursor_reset(t);
+ t->cursor.charset_index = 0;
+ for (u32 i = 0; i < ARRAY_COUNT(t->cursor.charsets); i++)
+ t->cursor.charsets[i] = CS_USA;
cursor_move_to(t, 0, 0);
cursor_alt(t, 1);
swap_screen(t);