Greg Haerr ####@####.####
4 Jan 2000 22:41:25 -0000
But how do yo suggest
: I get the "content" of the top line, if I'm storing ASCII and ESC/CSI
: values from the termio, there's alot of data to be stored for each
: screen if you are running an application like "worms"....? Am I making
: sence or just not seeing your point?
The way to do this is that the terminal emulator keeps an current
x, y cursor value. The terminal emulator alloc's a  array
and stores each incoming character in the current cursor location.
Then when refresh is required, the contents of the array are written
in whole to the display, thereby repainting all your worms.
As Alan Cox just mentioned, you don't want to draw the space
characters for speed. So, on a refresh, the current background
color is fillrect'ed to the display, then the non-space characters
are drawn. There are many other optimizations as well, having
to do with drawing each line at a time, etc while the attributes
are the same, etc.