bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: scrolling regions and ncurses demo program rain


From: Roumen Petrov
Subject: Re: scrolling regions and ncurses demo program rain
Date: Sun, 23 Aug 2020 15:52:27 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0 SeaMonkey/2.53.3

Hi,

Thomas Dickey wrote:
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.


Ok. So scroll region is due to output optimisation supported by some curses 
implementations.

[SNIP]


Thanks for details,
Roumen Petrov



reply via email to

[Prev in Thread] Current Thread [Next in Thread]