aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2019-11-17 09:02:46 +0000
committerDaniel Eklöf <daniel@ekloef.se>2019-11-17 09:02:46 +0000
commitc9ebd527cf01e49dc4094c1fbee5e133bf84c708 (patch)
treefb35fd0a576d1a5a399e2814436aee44c1723833
parentterm: convert anonymous 'charsets' struct to a named struct (diff)
term: save/restore charsets on save/restore cursor+attributes
-rw-r--r--terminal.c1
-rw-r--r--terminal.h1
-rw-r--r--vt.c8
3 files changed, 4 insertions, 6 deletions
diff --git a/terminal.c b/terminal.c
index 82a72747..5511eba5 100644
--- a/terminal.c
+++ b/terminal.c
@@ -828,6 +828,7 @@ term_reset(struct terminal *term, bool hard)
term->charsets.set[1] = CHARSET_ASCII;
term->charsets.set[2] = CHARSET_ASCII;
term->charsets.set[3] = CHARSET_ASCII;
+ term->saved_charsets = term->charsets;
tll_free_and_free(term->window_title_stack, free);
free(term->window_title);
term->window_title = strdup("foot");
diff --git a/terminal.h b/terminal.h
index db2eaec4..f5d7658f 100644
--- a/terminal.h
+++ b/terminal.h
@@ -184,6 +184,7 @@ struct terminal {
enum mouse_reporting mouse_reporting;
struct charsets charsets;
+ struct charsets saved_charsets; /* For save/restore cursor + attributes */
char *window_title;
tll(char *) window_title_stack;
diff --git a/vt.c b/vt.c
index 6fcaea2e..36c15fc8 100644
--- a/vt.c
+++ b/vt.c
@@ -597,17 +597,13 @@ esc_dispatch(struct terminal *term, uint8_t final)
case '7':
term->saved_cursor = term->cursor;
term->vt.saved_attrs = term->vt.attrs;
- //term->saved_charset = term->selected_charset;
- //for (size_t i = 0; i < 4; i++)
- // term->saved_charsets[i] = term->charset[i];
+ term->saved_charsets = term->charsets;
break;
case '8':
term_restore_cursor(term);
term->vt.attrs = term->vt.saved_attrs;
- //term->selected_charset = term->saved_charset;
- //for (size_t i = 0; i < 4; i++)
- // term->charset[i] = term->saved_charsets[i];
+ term->charsets = term->saved_charsets;
break;
case 'c':