Well, the question may sound a bit too vague but here’s 2 things I need to do and I’d definitely need some input on this :
-
Output something (e.g. using
cout) with color (note: MyTERMenvironment variable is set toxterm-colorif that makes any difference; also, is there any uniform way to output colored text that’s compatible with both pure mac and *nix terminals in general, so that the code is portable) -
Output something at the same position on the terminal screen. OK, this may sound confusing too. Let’s take a terminal app which simply outputs a progress percentage. It normally won’t start a new line for that. The new value is shown at the very same spot. How is this doable? (Being a once Borland Pascal guy from the good old DOS days, the only thing I could think of is something to do with accessing video memory directly… or not?)
So… any ideas?
You probably want to use ncurses library. And ANSI escape codes can also be used for coloring.