This is the mail archive of the
cygwin-developers@cygwin.com
mailing list for the Cygwin project.
[sourceware-bugzilla@sources.redhat.com: [Bug cygwin DLL/514] cygwin terminal: wrong color handling in reverse display mode]
- From: Christopher Faylor <me at cgf dot cx>
- To: cygwin-developers at cygwin dot com
- Date: Mon, 15 Nov 2004 16:56:20 -0500
- Subject: [sourceware-bugzilla@sources.redhat.com: [Bug cygwin DLL/514] cygwin terminal: wrong color handling in reverse display mode]
- Reply-to: cygwin-developers at cygwin dot com
Anyone interested in working on cygwin and fixing some
low hanging fruit?
cgf
----- Forwarded message from towo at towo dot net <sourceware-bugzilla> -----
------- Additional Comments From towo at towo dot net 2004-11-11 11:00 -------
The bug is in fhandler_console.cc, function get_win32_attr, where
foreground and background intensity are explicitly preserved while
exchanging color values:
WORD save_fg = win_fg;
win_fg = (win_bg & BACKGROUND_RED ? FOREGROUND_RED : 0) |
(win_bg & BACKGROUND_GREEN ? FOREGROUND_GREEN : 0) |
(win_bg & BACKGROUND_BLUE ? FOREGROUND_BLUE : 0) |
(win_fg & FOREGROUND_INTENSITY);
win_bg = (save_fg & FOREGROUND_RED ? BACKGROUND_RED : 0) |
(save_fg & FOREGROUND_GREEN ? BACKGROUND_GREEN : 0) |
(save_fg & FOREGROUND_BLUE ? BACKGROUND_BLUE : 0) |
(win_bg & BACKGROUND_INTENSITY);
This approach is wrong (because it's causing unreadable display)
and should probably be replaced with just:
WORD save_fg = win_fg;
win_fg = win_bg;
win_bg = save_fg;
----- End forwarded message -----