I'm running an xterm in which "ls --color" shows nice colors for all the
file types, but my ncurses code returns FALSE when I call has_colors().
What do I need to do to get colors to work? Code snippet at end.
Thanks.
--Fred
#include <stdio.h>
#include <curses.h>
int main()
{
int retval;
initscr();
cbreak();
noecho();
nonl();
intrflush(stdscr, FALSE);
keypad(stdscr, TRUE);
start_color();
if (FALSE == has_colors())
{
retval = -1;
}
else
{
retval = 0;
}
endwin();
if (retval == -1)
{
printf("no colors\n");
}
else
{
printf("has colors\n");
}
return retval;
Quote:}