From 5ffce7c42ef294cc938eee158c369ba7eb1abd13 Mon Sep 17 00:00:00 2001 From: mintsuki Date: Fri, 6 Aug 2021 06:16:41 +0200 Subject: [PATCH] term: Support DEC private escape 25 (enable/disable cursor) --- stage23/lib/term.s2.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/stage23/lib/term.s2.c b/stage23/lib/term.s2.c index e42cc440..3fa809b4 100644 --- a/stage23/lib/term.s2.c +++ b/stage23/lib/term.s2.c @@ -73,10 +73,12 @@ void term_deinit(void) { static void term_putchar(uint8_t c); +static bool old_cur_stat; + void term_write(const char *buf, size_t count) { if (term_backend == NOT_READY) return; - bool old_cur_stat = disable_cursor(); + old_cur_stat = disable_cursor(); for (size_t i = 0; i < count; i++) term_putchar(buf[i]); if (old_cur_stat) @@ -150,8 +152,18 @@ def: } static void dec_private_parse(uint8_t c) { - (void)c; dec_private = false; + + if (esc_values_i > 0) { + switch (esc_values[0]) { + case 25: { + switch (c) { + case 'h': old_cur_stat = true; return; + case 'l': old_cur_stat = false; return; + } + } + } + } } static void control_sequence_parse(uint8_t c) {