From f114068a468f6d6d39603b4ed26049de7b701842 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Thu, 19 Jan 2023 19:52:57 +0100 Subject: [PATCH] csi: DECCOLM+DECSCLM: remove all support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We don’t support neither 132 column mode, nor smooth scrolling. Thus it makes little sense to recognize these control condes. Note that while XTerm does support 132 columns, it is disabled by default. In this mode, XTerm also doesn’t trigger the side-effects (i.e. clearing the screen). Closes #1265 --- CHANGELOG.md | 2 ++ csi.c | 21 --------------------- 2 files changed, 2 insertions(+), 21 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4f1da5c1..d50eff6b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -139,6 +139,7 @@ * Crash when application output scrolls very fast, e.g. `yes` ([#1305][1305]). * Crash when application scrolls **many** lines (> ~2³¹). +* DECCOLM erasing the screen ([#1265][1265]). [1173]: https://codeberg.org/dnkl/foot/issues/1173 [1190]: https://codeberg.org/dnkl/foot/issues/1190 @@ -151,6 +152,7 @@ [1280]: https://codeberg.org/dnkl/foot/issues/1280 [1288]: https://codeberg.org/dnkl/foot/issues/1288 [1305]: https://codeberg.org/dnkl/foot/issues/1305 +[1265]: https://codeberg.org/dnkl/foot/issues/1265 ### Security diff --git a/csi.c b/csi.c index cef48d43..d22c1da5 100644 --- a/csi.c +++ b/csi.c @@ -276,21 +276,6 @@ decset_decrst(struct terminal *term, unsigned param, bool enable) enable ? CURSOR_KEYS_APPLICATION : CURSOR_KEYS_NORMAL; break; - case 3: - /* DECCOLM */ - if (enable) - LOG_WARN("unimplemented: 132 column mode (DECCOLM)"); - - term_erase(term, 0, 0, term->rows - 1, term->cols - 1); - term_cursor_home(term); - break; - - case 4: - /* DECSCLM - Smooth scroll */ - if (enable) - LOG_WARN("unimplemented: Smooth (Slow) Scroll (DECSCLM)"); - break; - case 5: /* DECSCNM */ term->reverse = enable; @@ -558,8 +543,6 @@ decrqm(const struct terminal *term, unsigned param) { switch (param) { case 1: return decrpm(term->cursor_keys_mode == CURSOR_KEYS_APPLICATION); - case 3: return DECRPM_PERMANENTLY_RESET; - case 4: return DECRPM_PERMANENTLY_RESET; case 5: return decrpm(term->reverse); case 6: return decrpm(term->origin); case 7: return decrpm(term->auto_margin); @@ -601,8 +584,6 @@ xtsave(struct terminal *term, unsigned param) { switch (param) { case 1: term->xtsave.application_cursor_keys = term->cursor_keys_mode == CURSOR_KEYS_APPLICATION; break; - case 3: break; - case 4: break; case 5: term->xtsave.reverse = term->reverse; break; case 6: term->xtsave.origin = term->origin; break; case 7: term->xtsave.auto_margin = term->auto_margin; break; @@ -644,8 +625,6 @@ xtrestore(struct terminal *term, unsigned param) bool enable; switch (param) { case 1: enable = term->xtsave.application_cursor_keys; break; - case 3: return; - case 4: return; case 5: enable = term->xtsave.reverse; break; case 6: enable = term->xtsave.origin; break; case 7: enable = term->xtsave.auto_margin; break;