Thanks for your replies. While I have not solved the issue with escape codes or got 'ncurses' library to work with my visualC compiler, I have solved it by using an implementation that is similar to Vim by:
1. including windows.h
2. Using
Code:
hStdOut = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleTextAttribute(hStdOut, color);
to change the text color
and
Code:
int getColors() const
{
CONSOLE_SCREEN_BUFFER_INFO csbi;
GetConsoleScreenBufferInfo(hStdOut, &csbi);
return csbi.wAttributes;
}
to get the system color.
Still, I'd very much prefer to change the colors with some in-text labels. The text gets a little easier to comprehend in the source and its faster to type...
I don't really understand peoples' complaints that Escape codes are 'invisible' or whatevs. Escape codes are pretty easy to understand and I've been using them for ages by now.
Perhaps I should try to write an ANSI interface that interprets ANSI codes in text and translates them into calls to SetConsoleTextAttribute() et al for Windows and something else for GNU/Linux. But perhaps ANSI works fine in Linux? I've seen demos somewhere of 256 ANSI colors in the terminal.