From: Pierre Habouzit Date: Mon, 12 Nov 2007 21:12:27 +0000 (+0100) Subject: Assume default colors are white on black for xterm, and use it if available. X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=commitdiff_plain;h=9438b6c87f1552be4389afe4abf7bdc3b30ad203 Assume default colors are white on black for xterm, and use it if available. Signed-off-by: Pierre Habouzit --- diff --git a/lib-ui/madtty.c b/lib-ui/madtty.c index 85bd257..4cc53fb 100644 --- a/lib-ui/madtty.c +++ b/lib-ui/madtty.c @@ -957,7 +957,6 @@ void madtty_init_colors(void) { if (COLOR_PAIRS > 64) { use_default_colors(); - assume_default_colors(-1, -1); has_default = 1; for (int bg = -1; bg < 8; bg++) { @@ -966,9 +965,16 @@ void madtty_init_colors(void) } } } else { + int use_default = use_default_colors() == OK; for (int bg = 0; bg < 8; bg++) { for (int fg = 0; fg < 8; fg++) { - init_pair((7 - fg) * 8 + bg, fg, bg); + if (use_default) { + init_pair((7 - fg) * 8 + bg, + fg == COLOR_WHITE ? -1 : fg, + bg == COLOR_BLACK ? -1 : bg); + } else { + init_pair((7 - fg) * 8 + bg, fg, bg); + } } } }