Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do console graphics work? (less, curses, vi...)

Can someone explain to me how less, vi and curses programs manage graphics output? Can they change individual characters on the screen or do they have to literary clear and redraw the screen whenever something changes?

It would be really neat if someone could hack a tiny less clone together, without all the boilerplate code.

like image 795
futlib Avatar asked Jan 31 '12 17:01

futlib


1 Answers

There exist special Escape Codes that, when sent to the terminal, instruct the terminal to reposition the cursor without disrupting what's already being displayed.

like image 167
Drew Dormann Avatar answered Nov 11 '22 19:11

Drew Dormann