From: btakahashi Date: Tue, 10 May 2005 00:08:12 +0000 (+0000) Subject: Applied Phil Endecott's patch to improve reverse-video escape-sequence handling X-Git-Url: http://git.madism.org/?a=commitdiff_plain;h=7ea77f37c3d2ad6f176182e2b1441dd33e39af8c;p=apps%2Fmadtty.git Applied Phil Endecott's patch to improve reverse-video escape-sequence handling --- diff --git a/inject_csi.c b/inject_csi.c index e7652aa..e2b6430 100644 --- a/inject_csi.c +++ b/inject_csi.c @@ -75,14 +75,17 @@ static void interpret_csi_SGR(RoteTerm *rt, int param[], int pcount) { ROTE_ATTR_MOD_BOLD(rt->curattr,1); else if (param[i] == 5) /* set blink */ ROTE_ATTR_MOD_BLINK(rt->curattr,1); - else if (param[i] == 7) rt->curattr = 0x07; /* reverse video */ + else if (param[i] == 7 || param[i] == 27) { /* reverse video */ + int fg = ROTE_ATTR_FG(rt->curattr); + int bg = ROTE_ATTR_BG(rt->curattr); + ROTE_ATTR_MOD_FG(rt->curattr, bg); + ROTE_ATTR_MOD_BG(rt->curattr, fg); + } else if (param[i] == 8) rt->curattr = 0x0; /* invisible */ else if (param[i] == 22 || param[i] == 24) /* bold off */ ROTE_ATTR_MOD_BOLD(rt->curattr,0); else if (param[i] == 25) /* blink off */ ROTE_ATTR_MOD_BLINK(rt->curattr,0); - else if (param[i] == 27) /* negative off */ - rt->curattr = 0x70; else if (param[i] == 28) /* invisible off */ rt->curattr = 0x70; else if (param[i] >= 30 && param[i] <= 37) /* set fg */