From bf4071fad04c9ea670aa8344b6bd20e4763a0082 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Thu, 23 Nov 2006 10:08:04 +0000 Subject: [PATCH] * fhandler_console.cc (set_color): Avoid (again) inappropriate intensity interchanging that used to render reverse output unreadable when (non-reversed) text is bright. See http://sourceware.org/bugzilla/show_bug.cgi?id=514 --- winsup/cygwin/ChangeLog | 7 +++++++ winsup/cygwin/fhandler_console.cc | 9 ++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index c4546f163..1b0973038 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,10 @@ +2006-11-23 Thomas Wolff + + * fhandler_console.cc (set_color): Avoid (again) inappropriate + intensity interchanging that used to render reverse output unreadable + when (non-reversed) text is bright. + See http://sourceware.org/bugzilla/show_bug.cgi?id=514 + 2006-11-23 Joe Loh * devices.h: Add additional SCSI disk block device numbers per diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/fhandler_console.cc index 82ede58cd..6f1e73961 100644 --- a/winsup/cygwin/fhandler_console.cc +++ b/winsup/cygwin/fhandler_console.cc @@ -948,6 +948,8 @@ dev_console::set_color (HANDLE h) (save_fg & FOREGROUND_BLUE ? BACKGROUND_BLUE : 0) | (save_fg & FOREGROUND_INTENSITY ? BACKGROUND_INTENSITY : 0); } + + /* apply attributes */ if (underline) win_fg = underline_color; /* emulate blink with bright background */ @@ -956,7 +958,12 @@ dev_console::set_color (HANDLE h) if (intensity == INTENSITY_INVISIBLE) win_fg = win_bg; else if (intensity == INTENSITY_BOLD) - win_fg |= FOREGROUND_INTENSITY; + /* apply foreground intensity only in non-reverse mode! */ + if (reverse) + win_bg |= BACKGROUND_INTENSITY; + else + win_fg |= FOREGROUND_INTENSITY; + current_win32_attr = win_fg | win_bg; if (h) SetConsoleTextAttribute (h, current_win32_attr);