aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2019-07-03 13:58:49 +0000
committerDaniel Eklöf <daniel@ekloef.se>2019-07-03 13:58:49 +0000
commit66033b9b1a80a393b19c6ffffcc25462a2012910 (patch)
tree7ecd3aa9e20cded82359c3dfe1092e095bbdd167
parentmain: mitigate screen flashes on slow client (diff)
csi: implement 'erase characters' (CSI X)
-rw-r--r--csi.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/csi.c b/csi.c
index 98055c5b..a9de94b2 100644
--- a/csi.c
+++ b/csi.c
@@ -473,6 +473,17 @@ csi_dispatch(struct terminal *term, uint8_t final)
break;
}
+ case 'X': {
+ /* Erase chars */
+ int count = min(
+ param_get(term, 0, 1), term->cols - term->cursor.col);
+
+ memset(&term->grid->cur_line[term->cursor.col],
+ 0, count * sizeof(term->grid->cur_line[0]));
+ term_damage_erase(term, term->cursor.linear, count);
+ break;
+ }
+
case 'l': {
/* Horizontal index */
assert(false && "untested");