From 975e70dae1d94e425745fd6b6447d4e3f748b75b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Fri, 11 Dec 2020 20:01:19 +0100 Subject: [PATCH] =?UTF-8?q?csi:=20=E2=80=98CSI=20s=E2=80=99=20and=20?= =?UTF-8?q?=E2=80=98CSI=20u=E2=80=99=20now=20saves/restores=20attributes?= =?UTF-8?q?=20and=20charsets?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 2 ++ csi.c | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 13e82dbe..9ea6b8aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -121,6 +121,8 @@ means foot can be PGO:d in e.g. sandboxed build scripts. See * Error when re-assigning a default key binding (https://codeberg.org/dnkl/foot/issues/233). +* `\E[s`+`\E[u` (save/restore cursor) now saves and restores + attributes and charset configuration, just like `\E7`+`\E8`. ### Security diff --git a/csi.c b/csi.c index eaa527a0..7893926a 100644 --- a/csi.c +++ b/csi.c @@ -1108,10 +1108,14 @@ csi_dispatch(struct terminal *term, uint8_t final) case 's': term->grid->saved_cursor = term->grid->cursor; + term->vt.saved_attrs = term->vt.attrs; + term->saved_charsets = term->charsets; break; case 'u': term_restore_cursor(term, &term->grid->saved_cursor); + term->vt.attrs = term->vt.saved_attrs; + term->charsets = term->saved_charsets; break; case 't': {