ncurses and fork
I wanted to use ncurses in a program with fork(), but it seems to screw things up. The only info I found with google were posts like this one with no reply...
Does that mean I'm up a creek? Are there any other options for using console colors? My only thought is to include functions with lots of this:
system("echo -e \"\[\033[1;31m\]\"");
which works, but produces warnings due to some nested conceptualization of escape sequences -- and also does this every time:
 or 
later...this works without warnings or extraneous output:
but it's still no ncurses
system("echo -en \"\033[1;36m\"");
It is probably sufficient to close() the terminal descriptors immediately after forking. ncurses can't screw up a terminal that has been closed.
You probably don't want those child processes writing to your terminal anyway, ncurses or not.
if(fork() == 0)
/* Whatever else */
Temporarily leaving "cooked" mode seems to work too:
I think this is the "terminal can't get screwed up if ncurses is closed" version.