summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordzwdz2023-06-08 18:49:41 +0200
committerdzwdz2023-06-08 18:49:41 +0200
commit8c1d2e29b9ef3472b46d6997ffde5ca38afdb5f3 (patch)
tree32ad1119219e3208cf66436d88e7e98cebc01c30
parent8f0c4e62ffeff86148547c968b0743813d70e649 (diff)
user/vterm: support displaying tabs
-rw-r--r--src/user/app/vterm/vterm.c5
1 files changed, 5 insertions, 0 deletions
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++;