I am trying to get a simple console program to work in windows (it works in linux). I uses curses on linux, and when moving to windows I found that the least troublesome way port my program was to use pdcurses. I have used pdcurses before in windows, but with the win32a addon. However, I would like this program to run inside the windows console.
The problem is that it just seems to completely ignore all color commands. Is this a problem with pdcurses on windows or am I just being stupid? Even the demos that come with the package don't have color. I am using MSVC++ express 2010 on Win7 64x.
hasColors()
returns TRUE
. When Ii run this simple example from the documentation, everything is still in black and white:
#include <curses.h>
int main()
{
initscr();
if(has_colors() == FALSE)
{ endwin();
printf("Your terminal does not support color\n");
exit(1);
}
start_color();
init_pair(1, COLOR_BLACK, COLOR_RED);
init_pair(2, COLOR_BLACK, COLOR_GREEN);
attron(COLOR_PAIR(1));
printw("This should be printed in black with a red background!\n");
attron(COLOR_PAIR(2));
printw("And this in a green background!\n");
refresh();
endwin();
}