dvtm

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

commit 0857de73219f4276fc4124259b5a168139db3346
parent 8621e2355e0d18fd394941297683db8ec7b275b2
Author: Marc Andre Tanner <mat@brain-dump.org>
Date:   Wed,  5 Jan 2011 21:12:17 +0100

madtty: cleanup DECSET/DECRST handling

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

Diffstat:
madtty.c | 48++++++++++++++++++++++++++----------------------
1 file changed, 26 insertions(+), 22 deletions(-)

diff --git a/madtty.c b/madtty.c @@ -642,34 +642,38 @@ static void es_interpret_csi(madtty_t *t) } if (t->ebuf[1] == '?') { - switch (verb) { - case 'l': - if (csiparam[0] == 25) - t->curshid = true; - if (csiparam[0] == 1) /* DECCKM: reset ANSI cursor (normal) key mode */ - t->curskeymode = 0; - if (csiparam[0] == 6) /* DECOM: set origin to absolute */ - t->relposmode = false; - if (csiparam[0] == 47) { - /* use normal screen buffer */ + if (verb == 'h') { /* DEC Private Mode Set (DECSET) */ + switch (csiparam[0]) { + case 1: /* set ANSI cursor (application) key mode (DECCKM) */ + t->curskeymode = true; + break; + case 6: /* set origin to relative (DECOM) */ + t->relposmode = true; + break; + case 25: /* make cursor visible (DECCM) */ + t->curshid = false; + break; + case 47: /* use alternate screen buffer */ t->curattrs = A_NORMAL; t->curfg = t->curbg = -1; + break; } - break; - - case 'h': - if (csiparam[0] == 25) - t->curshid = false; - if (csiparam[0] == 1) /* DECCKM: set ANSI cursor (application) key mode */ - t->curskeymode = 1; - if (csiparam[0] == 6) /* DECOM: set origin to relative */ - t->relposmode = true; - if (csiparam[0] == 47) { - /* use alternate screen buffer */ + } else if (verb == 'l') { /* DEC Private Mode Reset (DECRST) */ + switch (csiparam[0]) { + case 1: /* reset ANSI cursor (normal) key mode (DECCKM) */ + t->curskeymode = false; + break; + case 6: /* set origin to absolute (DECOM) */ + t->relposmode = false; + break; + case 25: /* make cursor visible (DECCM) */ + t->curshid = true; + break; + case 47: /* use normal screen buffer */ t->curattrs = A_NORMAL; t->curfg = t->curbg = -1; + break; } - break; } }