csi: implement 'erase characters' (CSI X)

This commit is contained in:
Daniel Eklöf 2019-07-03 15:58:49 +02:00
parent f87d4f856a
commit 66033b9b1a
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

11
csi.c
View file

@ -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");