diff --git a/src/ChangeLog b/src/ChangeLog index 4692c11fc..dfb228432 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,10 @@ 2001-05-29 Pavel Roskin + * color.h: Define DEFAULT_COLOR_INDEX and DEFAULT_COLOR in the + same way regardless of HAVE_SLANG. + * color.c (init_colors) [USE_NCURSES]: Initialize the default + color pair. + * subshell.c (pty_open_master) [!HAVE_SCO && HAVE_GRANTPT]: Don't try to close a file that wasn't opened. diff --git a/src/color.c b/src/color.c index e01485b7d..4b4fdc036 100644 --- a/src/color.c +++ b/src/color.c @@ -293,15 +293,21 @@ void init_colors (void) } #endif + if (use_colors) { #if defined HAVE_SLANG && !defined(HAS_DIRECT_COLOR_ACCESS) - if (use_colors) { /* We are relying on undocumented feature of - S-Lang to make COLOR_PAIR(DEFAULT_COLOR_INDEX) - the default fg/bg of the terminal. - Hopefully, future versions of S-Lang will - document this feature. */ + /* + * We are relying on undocumented feature of + * S-Lang to make COLOR_PAIR(DEFAULT_COLOR_INDEX) + * the default fg/bg of the terminal. + * Hopefully, future versions of S-Lang will + * document this feature. + */ SLtt_set_color (DEFAULT_COLOR_INDEX, NULL, NULL, NULL); +#elif USE_NCURSES + /* Always white on black */ + init_pair(DEFAULT_COLOR_INDEX, COLOR_WHITE, COLOR_BLACK); +#endif } -#endif for (i = 0; i < ELEMENTS (color_map); i++){ if (!color_map [i].name) diff --git a/src/color.h b/src/color.h index 43c63144d..c4997bd06 100644 --- a/src/color.h +++ b/src/color.h @@ -77,13 +77,9 @@ extern int dialog_colors [4]; #define CORE_COLOR (PORT_COLOR (MY_COLOR_PAIR (29),0)) -#ifdef HAVE_SLANG /* For the default color any unused index may be chosen. */ -# define DEFAULT_COLOR_INDEX 30 -# define DEFAULT_COLOR (PORT_COLOR (MY_COLOR_PAIR(DEFAULT_COLOR_INDEX),0)) -# else -# define DEFAULT_COLOR A_NORMAL -#endif +#define DEFAULT_COLOR_INDEX 30 +#define DEFAULT_COLOR (PORT_COLOR (MY_COLOR_PAIR(DEFAULT_COLOR_INDEX),0)) /* * editor colors - only 3 for normal, search->found, and select, respectively