csi: implement REP - CSI Ps b

This commit is contained in:
Daniel Eklöf 2020-01-20 18:37:20 +01:00
parent 2c8b31204f
commit 4e87426712
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
3 changed files with 18 additions and 0 deletions

16
csi.c
View file

@ -324,6 +324,22 @@ csi_dispatch(struct terminal *term, uint8_t final)
switch (term->vt.private[0]) {
case 0: {
switch (final) {
case 'b':
if (term->vt.last_printed != 0) {
/*
* Note: we never reset 'last-printed'. According to
* ECMA-48, the behaviour is undefined if REP was
* _not_ preceeded by a graphical character.
*/
int count = vt_param_get(term, 0, 1);
LOG_DBG("REP: '%C' %d times", term->vt.last_printed, count);
const int width = wcwidth(term->vt.last_printed);
for (int i = 0; i < count; i++)
term_print(term, term->vt.last_printed, width);
}
break;
case 'c': {
/* Send Device Attributes (Primary DA) */