diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2015-09-05 08:26:44 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2015-09-05 08:26:44 +0000 |
commit | 8952c06da2949d476820010236575fdbdeda1e41 (patch) | |
tree | 12c0a9314b03028cdbe7f2768f0a202dee76282e /sys/dev/wscons | |
parent | 6b4036f192244ead6c35ac59951fc7f62f5be7ee (diff) |
Support for xterm-compatible SGR escapes 39 and 49 (reset fg/bg colour to
default). From Matthew Martin on tech@
Diffstat (limited to 'sys/dev/wscons')
-rw-r--r-- | sys/dev/wscons/wsemul_vt100_subr.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/sys/dev/wscons/wsemul_vt100_subr.c b/sys/dev/wscons/wsemul_vt100_subr.c index c9249c5b0ba..1ce2963b5ef 100644 --- a/sys/dev/wscons/wsemul_vt100_subr.c +++ b/sys/dev/wscons/wsemul_vt100_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wsemul_vt100_subr.c,v 1.20 2015/03/14 03:38:50 jsg Exp $ */ +/* $OpenBSD: wsemul_vt100_subr.c,v 1.21 2015/09/05 08:26:43 miod Exp $ */ /* $NetBSD: wsemul_vt100_subr.c,v 1.7 2000/04/28 21:56:16 mycroft Exp $ */ /* @@ -576,12 +576,24 @@ wsemul_vt100_handle_csi(struct wsemul_vt100_emuldata *edp, flags |= WSATTR_WSCOLORS; fgcol = ARG(n) - 30; break; + case 39: + /* reset fg color */ + fgcol = WSCOL_WHITE; + if (bgcol == WSCOL_BLACK) + flags &= ~WSATTR_WSCOLORS; + 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; + if (fgcol == WSCOL_WHITE) + flags &= ~WSATTR_WSCOLORS; + break; default: #ifdef VT100_PRINTUNKNOWN printf("CSI%dm unknown\n", ARG(n)); |