From 8c24ed3189a9cf5a75809aa28f787d071615c0cd Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Mon, 9 Jun 2025 15:58:56 -0400 Subject: kernel: cons: Add ANSI cursor pos reset sequence - Add support for the "\033[H" ANSI escape sequence to reset the cursor to the 'home' position Signed-off-by: Ian Moffett --- sys/dev/cons/cons_ansi.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'sys/dev/cons/cons_ansi.c') diff --git a/sys/dev/cons/cons_ansi.c b/sys/dev/cons/cons_ansi.c index a91f1d3..4403f9c 100644 --- a/sys/dev/cons/cons_ansi.c +++ b/sys/dev/cons/cons_ansi.c @@ -88,6 +88,13 @@ ansi_feed(struct ansi_state *statep, char c) statep->csi = 2; statep->prev = c; return c; + case 2: + if (c == 'H') { + cons_reset_cursor(&g_root_scr); + ansi_reset(statep); + return ANSI_UPDATE_CURSOR; + } + break; } if (!statep->set_fg && !statep->set_bg) { -- cgit v1.2.3