From 1a5c2f5761210a05602c7c7e799ccb0f059b42ff Mon Sep 17 00:00:00 2001 From: Pierre-Alexandre Meyer Date: Sun, 30 Aug 2009 23:37:01 -0700 Subject: [PATCH] cmenu: fix background color The menu highlights some characters to mark them as key shortcuts. To switch the bold attribute off, we were printing the reset code, resetting the background color in the same time. Use ANSI sequence 22 instead. Signed-off-by: Pierre-Alexandre Meyer --- com32/cmenu/libmenu/com32io.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/com32/cmenu/libmenu/com32io.c b/com32/cmenu/libmenu/com32io.c index 92344da..ca207ee 100644 --- a/com32/cmenu/libmenu/com32io.c +++ b/com32/cmenu/libmenu/com32io.c @@ -37,8 +37,12 @@ static void cprint_vga2ansi(const char chr, const char attr) *p++ = '\033'; *p++ = '['; + /* Beware! Do not use '1': this will reset all attributes off, + * including the background color - as a result, the background + * would be black after the highlight area */ if (last_attr & ~attr & 0x88) { - *p++ = '0'; + *p++ = '2'; + *p++ = '2'; *p++ = ';'; } if (attr & 0x08) { -- 2.7.4