summaryrefslogtreecommitdiffstats
path: root/sys/dev/vt
diff options
context:
space:
mode:
authorray <ray@FreeBSD.org>2014-04-17 14:18:30 +0000
committerray <ray@FreeBSD.org>2014-04-17 14:18:30 +0000
commitcd3c0c789715efb8c89f2f7a73d2eb85c0cf3e13 (patch)
treebb6c3fb850a58f17994881fb9f2f9432df41d692 /sys/dev/vt
parent9bf14ad939416998831e5f0523105f0de530c1d5 (diff)
downloadFreeBSD-src-cd3c0c789715efb8c89f2f7a73d2eb85c0cf3e13.zip
FreeBSD-src-cd3c0c789715efb8c89f2f7a73d2eb85c0cf3e13.tar.gz
MFC r264258
Fix cursor color in reverse video mode. Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'sys/dev/vt')
-rw-r--r--sys/dev/vt/vt_core.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/sys/dev/vt/vt_core.c b/sys/dev/vt/vt_core.c
index 0cf0292..eb2843e 100644
--- a/sys/dev/vt/vt_core.c
+++ b/sys/dev/vt/vt_core.c
@@ -652,24 +652,26 @@ static inline void
vt_determine_colors(term_char_t c, int cursor,
term_color_t *fg, term_color_t *bg)
{
+ term_color_t tmp;
+ int invert;
+
+ invert = 0;
*fg = TCHAR_FGCOLOR(c);
if (TCHAR_FORMAT(c) & TF_BOLD)
*fg = TCOLOR_LIGHT(*fg);
*bg = TCHAR_BGCOLOR(c);
- if (TCHAR_FORMAT(c) & TF_REVERSE) {
- term_color_t tmp;
+ if (TCHAR_FORMAT(c) & TF_REVERSE)
+ invert ^= 1;
+ if (cursor)
+ invert ^= 1;
+ if (invert) {
tmp = *fg;
*fg = *bg;
*bg = tmp;
}
-
- if (cursor) {
- *fg = *bg;
- *bg = TC_WHITE;
- }
}
static void
OpenPOWER on IntegriCloud