From 32d9895697584988056086cbecdc96375b4b9115 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Tue, 26 Apr 2022 21:05:17 +0200 Subject: [PATCH] term: reset sixel options when hard resetting the terminal state --- CHANGELOG.md | 2 ++ terminal.c | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 31c05401..07c3dfbf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -68,6 +68,8 @@ scrollback search mode ([#1036][1036]). * Scrollback search mode not always highlighting all matches correctly. +* Sixel options not being reset on hard resets (`\Ec`) + [1040]: https://codeberg.org/dnkl/foot/issues/1040 [1036]: https://codeberg.org/dnkl/foot/issues/1036 diff --git a/terminal.c b/terminal.c index 9199aa31..dcaca033 100644 --- a/terminal.c +++ b/terminal.c @@ -1929,6 +1929,16 @@ term_reset(struct terminal *term, bool hard) tll_free(term->alt.scroll_damage); term->render.last_cursor.row = NULL; term_damage_all(term); + + term->sixel.scrolling = true; + term->sixel.cursor_right_of_graphics = false; + term->sixel.use_private_palette = true; + term->sixel.max_width = SIXEL_MAX_WIDTH; + term->sixel.max_height = SIXEL_MAX_HEIGHT; + term->sixel.palette_size = SIXEL_MAX_COLORS; + free(term->sixel.private_palette); + free(term->sixel.shared_palette); + term->sixel.private_palette = term->sixel.shared_palette = NULL; } static bool