Currently on the console
echo '\033[34mblue\033[39m white'
will echo both words with a blue foreground. Add support for SGR 39 and
49 that reset the fg and bg color respectively back to default.
- Matthew Martin
Index: wsemul_vt100_subr.c
===================================================================
RCS file: /cvs/src/sys/dev/wscons/wsemul_vt100_subr.c,v
retrieving revision 1.20
diff -u -p -r1.20 wsemul_vt100_subr.c
--- wsemul_vt100_subr.c 14 Mar 2015 03:38:50 -0000 1.20
+++ wsemul_vt100_subr.c 12 Jul 2015 17:05:41 -0000
@@ -576,11 +576,19 @@ wsemul_vt100_handle_csi(struct wsemul_vt
flags |= WSATTR_WSCOLORS;
fgcol = ARG(n) - 30;
break;
+ case 39:
+ /* reset fg color */
+ fgcol = WSCOL_WHITE;
+ break;
case 40: case 41: case 42: case 43:
case 44: case 45: case 46: case 47:
/* bg color */
flags |= WSATTR_WSCOLORS;
bgcol = ARG(n) - 40;
+ break;
+ case 49:
+ /* reset bg color */
+ bgcol = WSCOL_BLACK;
break;
default:
#ifdef VT100_PRINTUNKNOWN