From 66033b9b1a80a393b19c6ffffcc25462a2012910 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Wed, 3 Jul 2019 15:58:49 +0200 Subject: [PATCH] csi: implement 'erase characters' (CSI X) --- csi.c | 11 +++++++++++ 1 file changed, 11 insertions(+) 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");