diff options
author | Ian Moffett <ian@osmora.org> | 2025-07-07 00:58:55 +0000 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2025-07-07 00:58:55 +0000 |
commit | 7ca4b1c0537ec41f4b7b05ad61b48ff0bb29af8b (patch) | |
tree | 55629ce341bbd09029d62b551128674cef8ac686 /sys | |
parent | 37b755d8592dcb6b669bb5b9696b012ba0a07e50 (diff) |
kernel: ansi: Clear screen with "\033[2J"
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/cons/cons_ansi.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/sys/dev/cons/cons_ansi.c b/sys/dev/cons/cons_ansi.c index e00bdc9..69146b7 100644 --- a/sys/dev/cons/cons_ansi.c +++ b/sys/dev/cons/cons_ansi.c @@ -99,8 +99,17 @@ ansi_feed(struct ansi_state *statep, char c) statep->prev = c; return c; case 2: - if (c == 'H') { + if (c == '2') { + statep->csi = 3; + statep->prev = c; + return c; + } + break; + case 3: + /* Did we get '\033[2J' ? */ + if (statep->prev == '2' && c == 'J') { cons_clear_scr(scr, g_root_scr.bg); + ansi_reset(statep); return ANSI_UPDATE_CURSOR; } break; |