From: Francois Fleuret Date: Fri, 1 May 2009 13:58:24 +0000 (+0200) Subject: Cosmetics. X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=commitdiff_plain;h=c04bae20d28e2a15fff43974aa0804f425c65db2;p=selector.git Cosmetics. --- diff --git a/selector.cc b/selector.cc index ebe528e..a1b5b11 100644 --- a/selector.cc +++ b/selector.cc @@ -827,8 +827,11 @@ int main(int argc, char **argv) { keypad(stdscr, TRUE); if(with_colors) { + if(has_colors()) { + start_color(); + if(color_fg_modeline < 0 || color_fg_modeline >= COLORS || color_bg_modeline < 0 || color_bg_modeline >= COLORS || color_fg_highlight < 0 || color_bg_highlight >= COLORS || @@ -838,8 +841,10 @@ int main(int argc, char **argv) { cerr << "Color numbers have to be between 0 and " << COLORS - 1 << "." << endl; exit(1); } - init_pair(COLOR_MODELINE , color_fg_modeline, color_bg_modeline); + + init_pair(COLOR_MODELINE, color_fg_modeline, color_bg_modeline); init_pair(COLOR_HIGHLIGHTED_LINE, color_fg_highlight, color_bg_highlight); + } else { with_colors = 0; }