[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: scrolling regions and ncurses demo program rain
From: |
Thomas Dickey |
Subject: |
Re: scrolling regions and ncurses demo program rain |
Date: |
Thu, 20 Aug 2020 15:12:30 -0400 |
User-agent: |
NeoMutt/20170113 (1.7.2) |
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.
NetBSD curses does much the same - perhaps something I should add to
https://invisible-island.net/ncurses/ncurses-netbsd.html
since it appears to have been adapted from ncurses:
http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libcurses/refresh.c?rev=1.11&content-type=text/x-cvsweb-markup&only_with_tag=MAIN
http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libcurses/refresh.c.diff?r1=1.10&r2=1.11&only_with_tag=MAIN
The change comment says something different. However:
Solaris SVr4 curses (which you can see in illumos-gate) doesn't appear
to use scrolling regions in this manner. The same applies to Solaris'
xpg4 curses.
> > The reset program (or "tput reset") would do this,
> > but not a typical program.
> >
> > > Which part of code is responsible for this?
> > >
> > >
> > > Regards,
> > > Roumen Petrov
> > >
> >
>
> Roumen
--
Thomas E. Dickey <dickey@invisible-island.net>
https://invisible-island.net
ftp://ftp.invisible-island.net
signature.asc
Description: PGP signature