From 04236744089d8690a59be3c66cdeee97448c6d81 Mon Sep 17 00:00:00 2001 From: Ali Gholami Rudi Date: Sat, 11 Jul 2009 10:22:40 +0430 Subject: [PATCH] term: enable hiding the cursor --- term.c | 3 ++- vt102.c | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/term.c b/term.c index 80f7930..60ac0b1 100644 --- a/term.c +++ b/term.c @@ -19,6 +19,7 @@ static int row, col; static int fg, bg; static struct square screen[MAXCHARS]; static int top, bot; +static int nocursor; static void setsize(void) { @@ -43,7 +44,7 @@ static void term_show(int r, int c, int cursor) struct square *sqr = SQRADDR(r, c); int fgcolor = sqr->c ? sqr->fg : fg; int bgcolor = sqr->c ? sqr->bg : bg; - if (cursor) { + if (cursor && !nocursor) { int t = fgcolor; fgcolor = bgcolor; bgcolor = t; diff --git a/vt102.c b/vt102.c index 378966a..eed5962 100644 --- a/vt102.c +++ b/vt102.c @@ -279,6 +279,9 @@ static void csiseq(void) static void modeseq(int c, int set) { switch(c) { + case 0x99: /* DECTCEM Cursor on (set); Cursor off (reset) */ + nocursor = !set; + break; case 0x00: /* IGN Error (Ignored) */ case 0x01: /* GATM guarded-area transfer mode (ignored) */ case 0x02: /* KAM keyboard action mode (always reset) */ @@ -311,7 +314,6 @@ static void modeseq(int c, int set) case 0x89: /* DECINLM Interlace */ case 0x92: /* DECPFF Send FF to printer after print screen (set); No char after PS (reset) */ case 0x93: /* DECPEX Print screen: prints full screen (set); prints scroll region (reset) */ - case 0x99: /* DECTCEM Cursor on (set); Cursor off (reset) */ default: printf("modeseq: <0x%x>\n", c); break; -- 2.11.4.GIT