From d8a8fa32fb988e91cce17b18e2b79d35793526b6 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Sat, 28 Jun 2025 18:48:51 -0400 Subject: kernel: cons: Handle horizontal tabs ('\t') Signed-off-by: Ian Moffett --- sys/dev/cons/cons.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'sys') diff --git a/sys/dev/cons/cons.c b/sys/dev/cons/cons.c index 0735f11..8470a60 100644 --- a/sys/dev/cons/cons.c +++ b/sys/dev/cons/cons.c @@ -174,6 +174,15 @@ cons_handle_special(struct cons_screen *scr, char c) } switch (c) { + case ASCII_HT: + HIDE_CURSOR(scr); + scr->curs_col += 4; + scr->ch_col += 4; + if (scr->ch_col >= scr->ncols - 1) { + cons_handle_special(scr, '\n'); + } + SHOW_CURSOR(scr); + return 0; case ASCII_NUL: return 0; case ASCII_BS: -- cgit v1.2.3