diff options
author | Ian Moffett <ian@osmora.org> | 2025-06-09 15:58:56 -0400 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2025-06-09 15:58:56 -0400 |
commit | 8c24ed3189a9cf5a75809aa28f787d071615c0cd (patch) | |
tree | 01c8b73ecc4667d3c84ba3cd3dc2d98e3ecd1299 /sys/dev/cons/cons.c | |
parent | 802b5be90d58aeb2344b100d81f88a053b6e0c24 (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.c')
-rw-r--r-- | sys/dev/cons/cons.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/sys/dev/cons/cons.c b/sys/dev/cons/cons.c index 88f394b..ce2b154 100644 --- a/sys/dev/cons/cons.c +++ b/sys/dev/cons/cons.c @@ -422,6 +422,17 @@ cons_update_color(struct cons_screen *scr, uint32_t fg, uint32_t bg) scr->bg = bg; } +void +cons_reset_cursor(struct cons_screen *scr) +{ + HIDE_CURSOR(scr); + scr->ch_col = 0; + scr->ch_row = 0; + scr->curs_col = 0; + scr->curs_row = 0; + SHOW_CURSOR(scr); +} + /* * Put a character on the screen. * |