From e7c90ca9615b1a90035d3b607ca09cb2a538fcd5 Mon Sep 17 00:00:00 2001 From: Ali Gholami Rudi Date: Mon, 15 Jun 2015 19:10:09 +0430 Subject: [PATCH] term: do not terminate VT100 attributes with a semicolon Reported by Christian Neukirchen . --- term.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/term.c b/term.c index 38403fb..879eb39 100644 --- a/term.c +++ b/term.c @@ -171,22 +171,22 @@ char *term_att(int att, int old) int bg = SYN_BG(att); if (att == old) return ""; - s += sprintf(s, "\33[m\33["); + s += sprintf(s, "\33["); if (fg & SYN_BD) - s += sprintf(s, "1;"); + s += sprintf(s, ";1"); if (fg & SYN_IT) - s += sprintf(s, "3;"); + s += sprintf(s, ";3"); else if (fg & SYN_RV) - s += sprintf(s, "7;"); + s += sprintf(s, ";7"); if ((fg & 0xff) < 8) - s += sprintf(s, "%d;", 30 + (fg & 0xff)); + s += sprintf(s, ";%d", 30 + (fg & 0xff)); else - s += sprintf(s, "38;5;%d;", (fg & 0xff)); + s += sprintf(s, ";38;5;%d", (fg & 0xff)); if (bg) { if ((bg & 0xff) < 8) - s += sprintf(s, "%d;", 40 + (bg & 0xff)); + s += sprintf(s, ";%d", 40 + (bg & 0xff)); else - s += sprintf(s, "48;5;%d;", (bg & 0xff)); + s += sprintf(s, ";48;5;%d", (bg & 0xff)); } s += sprintf(s, "m"); return buf; -- 2.11.4.GIT