From 8c1d2e29b9ef3472b46d6997ffde5ca38afdb5f3 Mon Sep 17 00:00:00 2001 From: dzwdz Date: Thu, 8 Jun 2023 18:49:41 +0200 Subject: user/vterm: support displaying tabs --- src/user/app/vterm/vterm.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/user/app/vterm/vterm.c b/src/user/app/vterm/vterm.c index a7d5bcc..f365f6b 100644 --- a/src/user/app/vterm/vterm.c +++ b/src/user/app/vterm/vterm.c @@ -18,6 +18,11 @@ void in_char(char c) { case '\b': if (cursor.x > 0) cursor.x--; break; + case '\t': + /* rounds down to nearest multiple of 8 and adds 8 + = adding 1 and rounding up to the nearest multiple of 8 */ + cursor.x = (cursor.x & ~7) + 8; + break; default: font_blit(c, cursor.x, cursor.y); cursor.x++; -- cgit v1.2.3