projects
/
apps
/
madmutt.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1991ce5
)
Assume default colors are white on black for xterm, and use it if available.
author
Pierre Habouzit
<madcoder@debian.org>
Mon, 12 Nov 2007 21:12:27 +0000
(22:12 +0100)
committer
Pierre Habouzit
<madcoder@debian.org>
Mon, 12 Nov 2007 21:12:27 +0000
(22:12 +0100)
Signed-off-by: Pierre Habouzit <madcoder@debian.org>
lib-ui/madtty.c
patch
|
blob
|
history
diff --git
a/lib-ui/madtty.c
b/lib-ui/madtty.c
index
85bd257
..
4cc53fb
100644
(file)
--- 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);
+ }
}
}
}