summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2019-08-10 15:54:12 -0400
committerJune McEnroe <june@causal.agency>2019-08-10 15:54:12 -0400
commit12df16a98ad58ab8fe019d0a71f72cb6dcebfdd0 (patch)
tree75fcd52e8d515deab47ca6b5d57d89ed4fae9439
parentRewrite terminal emulator (diff)
downloadstream-12df16a98ad58ab8fe019d0a71f72cb6dcebfdd0.tar.gz
stream-12df16a98ad58ab8fe019d0a71f72cb6dcebfdd0.zip
Handle HT
-rw-r--r--term.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/term.c b/term.c
index b7c7e66..52e9257 100644
--- a/term.c
+++ b/term.c
@@ -133,6 +133,7 @@ static void escUnhandled(struct Term *t, wchar_t ch) {
 #define P(i, z) ((i) < t->param.n ? t->param.s[(i)] : (z))
 
 ACTION(bs)  { if (X) X--; }
+ACTION(ht)  { X = MIN(X - X % 8 + 8, R); }
 ACTION(cr)  { X = 0; }
 ACTION(cuu) { Y -= MIN(P(0, 1), Y); }
 ACTION(cud) { Y  = MIN(Y + P(0, 1), B); }
@@ -352,6 +353,7 @@ static Action *Actions[][128] = {
 	[NUL][0]   = add,
 	[NUL][BEL] = nop,
 	[NUL][BS]  = bs,
+	[NUL][HT]  = ht,
 	[NUL][NL]  = nl,
 	[NUL][CR]  = cr,
 	[NUL][ESC] = esc,