diff options
author | Toomas Soome <tsoome@me.com> | 2016-07-20 20:12:57 +0300 |
---|---|---|
committer | Dan McDonald <danmcd@omniti.com> | 2016-07-21 14:32:15 -0400 |
commit | b6bd4f488cd95b4b547777e8a8ca2045ebb34fad (patch) | |
tree | a78a2d548230f2dc1ec63b057adb5bd2ffd0e605 /usr/src/uts/common/io/tem.c | |
parent | 92b33eab9463d6c4878cfe65febf2ff232689649 (diff) | |
download | illumos-joyent-b6bd4f488cd95b4b547777e8a8ca2045ebb34fad.tar.gz |
7201 wscons background and foreground white should agree on shade
7202 wscons should support bright colour SGR sequences
Reviewed by: Joshua M. Clulow <jmc@joyent.com>
Reviewed by: Hans Rosenfeld <rosenfeld@grumpf.hope-2000.org>
Approved by: Dan McDonald <danmcd@omniti.com>
Diffstat (limited to 'usr/src/uts/common/io/tem.c')
-rw-r--r-- | usr/src/uts/common/io/tem.c | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/usr/src/uts/common/io/tem.c b/usr/src/uts/common/io/tem.c index 33e42fd982..c4f26a4426 100644 --- a/usr/src/uts/common/io/tem.c +++ b/usr/src/uts/common/io/tem.c @@ -756,8 +756,7 @@ tems_reset_colormap(cred_t *credp, enum called_from called_from) } void -tem_get_size(ushort_t *r, ushort_t *c, - ushort_t *x, ushort_t *y) +tem_get_size(ushort_t *r, ushort_t *c, ushort_t *x, ushort_t *y) { mutex_enter(&tems.ts_lock); *r = (ushort_t)tems.ts_c_dimension.height; @@ -768,8 +767,7 @@ tem_get_size(ushort_t *r, ushort_t *c, } void -tem_register_modechg_cb(tem_modechg_cb_t func, - tem_modechg_cb_arg_t arg) +tem_register_modechg_cb(tem_modechg_cb_t func, tem_modechg_cb_arg_t arg) { mutex_enter(&tems.ts_lock); @@ -920,8 +918,24 @@ tems_get_initial_color(tem_color_t *pcolor) flags |= TEM_ATTR_REVERSE; if (inverse_screen) flags |= TEM_ATTR_SCREEN_REVERSE; - if (flags != 0) + + if (flags != 0) { + /* + * If either reverse flag is set, the screen is in + * white-on-black mode. We set the bold flag to + * improve readability. + */ flags |= TEM_ATTR_BOLD; + } else { + /* + * Otherwise, the screen is in black-on-white mode. + * The SPARC PROM console, which starts in this mode, + * uses the bright white background colour so we + * match it here. + */ + if (pcolor->bg_color == ANSI_COLOR_WHITE) + flags |= TEM_ATTR_BRIGHT_BG; + } } pcolor->a_flags = flags; |