www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Console operations

reply orgoton mindless.com <orgoton mindless.com> writes:
How do I clear the console without have to use 

version (Windows) system("cls");
version (linux) system("clear");

Also how do I change BG/FG output color?

Thanks in advance.
Jan 30 2007
parent Dawid =?UTF-8?B?Q2nEmcW8YXJraWV3aWN6?= <dawid.ciezarkiewicz asn.pl> writes:
orgoton mindless.com wrote:

 How do I clear the console without have to use
 
 version (Windows) system("cls");
 version (linux) system("clear");
 
 Also how do I change BG/FG output color?
 
 Thanks in advance.
Portably? Use escape sequences for terminal or ncurses. Or just learn non-canonical mode of unix terminal. Terminals were invented long time ago to print lines and read lines without any formating like colors. If you do anything beyond simple reading and writing, you are dealing with quite complicated things. IMO, best for you will be using ncurses.
Jan 30 2007