dvtm

dynamic virtual terminal manager - with my changes
git clone https://pi.duncano.de/git/dvtm.git
Log | Files | Refs | README | LICENSE

commit d2eabd219938ee521802eddb4f8e5a4a25a061c7
parent 26c3278bce853a75e9645fe85bcd3d3560ef8962
Author: Marc Andre Tanner <mat@brain-dump.org>
Date:   Wed,  5 Jan 2011 23:38:34 +0100

madtty: interpret cursor control characters inside ESC sequences

Signed-off-by: Marc Andre Tanner <mat@brain-dump.org>

Diffstat:
madtty.c | 10+++++++---
1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/madtty.c b/madtty.c @@ -188,6 +188,8 @@ static char const * const keytable[KEY_MAX+1] = { [KEY_F(20)] = "\e[34~", }; +static void madtty_process_nonprinting(madtty_t *t, wchar_t wc); + __attribute__((const)) static uint16_t build_attrs(unsigned curattrs) { return ((curattrs & ~A_COLOR) | COLOR_PAIR(curattrs & 0xff)) @@ -627,12 +629,14 @@ static void es_interpret_csi(madtty_t *t) p += (t->ebuf[1] == '?'); /* CSI private mode */ /* parse numeric parameters */ - while (isdigit((unsigned char)*p) || *p == ';') { - if (*p == ';') { + while (*p) { + if (IS_CONTROL(*p)) { + madtty_process_nonprinting(t, *p); + } else if (*p == ';') { if (param_count >= (int)sizeof(csiparam)) return; /* too long! */ csiparam[param_count++] = 0; - } else { + } else if (isdigit((unsigned char)*p)) { if (param_count == 0) csiparam[param_count++] = 0; csiparam[param_count - 1] *= 10;