aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-07-14 08:47:17 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-07-14 08:47:17 +0000
commitcabcc615c1b22101ce30121fcedee457a61559da (patch)
treedef0668876fa706ca17016bff6ec3991fb1bd94b
parentterm: line-wrap: use term_cursor_{down,left} (diff)
vt: change HT (horizontal tab) to *not* clear LCF
According to the specification, HT **should** clear LCF. However, nearly all emulators do not. In particular, XTerm doesn't. So we follow suite.
-rw-r--r--CHANGELOG.md2
-rw-r--r--vt.c6
2 files changed, 8 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index bd172a47..1d18d1f3 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -96,6 +96,8 @@
(https://codeberg.org/dnkl/foot/issues/35).
* `C0::VT` to be processed as `C0::LF`. Previously, `C0::VT` would
only move the cursor down, but never scroll.
+* HT (_Horizontal Tab_, or `\t`) no longer clears `LCF` (_Last Column
+ Flag_).
### Security
diff --git a/vt.c b/vt.c
index 1254d28b..8d9d6cfa 100644
--- a/vt.c
+++ b/vt.c
@@ -142,7 +142,13 @@ action_execute(struct terminal *term, uint8_t c)
}
}
assert(new_col >= term->grid->cursor.point.col);
+
+ /* According to the specification, HT _should_ cancel LCF. But
+ * XTerm, and nearly all other emulators, don't. So we follow
+ * suite */
+ bool lcf = term->grid->cursor.lcf;
term_cursor_right(term, new_col - term->grid->cursor.point.col);
+ term->grid->cursor.lcf = lcf;
break;
}