diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2020-01-20 17:37:20 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2020-01-20 17:45:14 +0000 |
| commit | 4e874267129b8f70af23d33d1a3163a26d75cc99 (patch) | |
| tree | 3692c6a186f54a15d8d5c48246824ca44221f82b /csi.c | |
| parent | render: fallback to background color if cursor text color is not set (diff) | |
csi: implement REP - CSI Ps b
Diffstat (limited to 'csi.c')
| -rw-r--r-- | csi.c | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -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) */ |
