views:

60

answers:

3

I know that to update something like a progress bar on the command line, one uses '\r'. Is there any way to update multiple lines?

+1  A: 

You can use VT100 codes to reposition the cursor on a higher line, then overdraw it with your updated status.

bdonlan
+1  A: 

The Curses library offers powerful control for console UIs.

Suppressingfire
+1  A: 

The best way is to use some existing library like ncurses. But you may try dirty workaround by clearing console with system call system("cls");

doc
Is system("cls") Windows-only?
yodie
On Linux there is "clear"
doc
What about OS X?
yodie
OS X core Darwin is Unix compliant and it should have "clear" along with other Unix-like systems.
doc
Awesome. Thanks.
yodie