Applications can manipulate text based consoles or terminals, and change their colors, set cursor position. The supported approaches are:
- For Unix-like systems: There is
ANSI escape code. - For Windows systems: There is APIs like
SetConsoleTextAttribute. - …
but, is there any lightweight and portable C/C++ library which handles differences between operating systems just for colors and cursor? and do nothing if it was technically impossible but best effort.
Note: I’m not searching for heavy external tools to emulate unix-like terminals (like Cygwin, Msys-rxvt, …). I think a simple portability will be achieved with Windows APIs and ANSI escape codes. And not ncurses because it’s heavy and has many functionality to full control console and I think it needs emulation.
Alright, i finally found a portable and easy to use library:
rlutil.hUsage:
but, i will be glad for other suggestions.