summaryrefslogtreecommitdiff
path: root/sys/dev/cons/cons_ansi.c
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2025-06-09 15:58:56 -0400
committerIan Moffett <ian@osmora.org>2025-06-09 15:58:56 -0400
commit8c24ed3189a9cf5a75809aa28f787d071615c0cd (patch)
tree01c8b73ecc4667d3c84ba3cd3dc2d98e3ecd1299 /sys/dev/cons/cons_ansi.c
parent802b5be90d58aeb2344b100d81f88a053b6e0c24 (diff)
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 <ian@osmora.org>
Diffstat (limited to 'sys/dev/cons/cons_ansi.c')
-rw-r--r--sys/dev/cons/cons_ansi.c7
1 files changed, 7 insertions, 0 deletions
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) {