Overwriting the console as top

Okay, so I'm just wondering how console applications like top(1)for linux overwrite multiple lines. I want to know how to do this for C ++ or C. I know how to overwrite 1 line by simply placing a \ r, but I would like to know how to do this for multiple lines, again as above or if possible.

+5
source share
2 answers

They use trailing escape sequences to move the cursor around the screen. Some even use direct access to the framebuffer to treat the screen as an array of characters that can be directly indexed.

The library curses(or ncurses) is a good level of abstraction.

+3
source

, curses (ncurses ).

+2

All Articles