On Thu, Aug 20, 2020 at 09:28:49PM +0300, Roumen Petrov wrote:
Hi,
Thomas Dickey wrote:
On Wed, Aug 19, 2020 at 10:59:24PM +0300, Roumen Petrov wrote:
Hello,
I read code of rain program and library code but some things are not clear to
me.
Why demo program uses escape sequence to set margins on screen?
Which particular escape sequence are you talking about?
Esc [ Pn ; Pn r - set top and bottom margins
DEC used "margin" for left/right and top/bottom, but in most
other contexts (e.g., termcap, terminfo and curses),
that's a "scroll region".
Attached picture shows a dump of program output.
In terminfo, you'd see "csr".
man 5 terminfo:
change_scroll_region csr cs change region to
line #1 to line #2
(P)
curses (not just ncurses) does this when updating the screen.
In ncurses, that's used when the library decides that it would
be more efficient to shift the existing text up or down and paint
just a few lines rather than several lines.