summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorray <ray@FreeBSD.org>2014-04-08 14:14:25 +0000
committerray <ray@FreeBSD.org>2014-04-08 14:14:25 +0000
commitd42cbcb075e16b75b279943d1c2073a9b6b75c2a (patch)
treeeb2dc3fd39b11bc5abc08b5ea43862119bc6128a
parentd63688262205b134f2094bf73f207f082368fa26 (diff)
downloadFreeBSD-src-d42cbcb075e16b75b279943d1c2073a9b6b75c2a.zip
FreeBSD-src-d42cbcb075e16b75b279943d1c2073a9b6b75c2a.tar.gz
Fix cursor color in reverse video mode.
PR: kern/188196 Submitted by: Claude Buisson <clbuisson@orange.fr> (original version) MFC after: 1 week Sponsored by: The FreeBSD Foundation
-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 1c183c1..fa36482 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