[comp.unix.questions] TERMCAP experts READ UP!!!

cs00chs@unccvax.UUCP (charles spell) (02/13/90)

Are the sf= and sr= entries supposed to scroll the entire screen no
matter where the cursor is located or are they for only when the cursor
is on the top (sf=) and bottom (sr=) lines? Thanx for your time...

____o
Signature? Nahhhh...

gwyn@smoke.BRL.MIL (Doug Gwyn) (02/14/90)

In article <1831@unccvax.UUCP> cs00chs@unccvax.UUCP (charles spell) writes:
>Are the sf= and sr= entries supposed to scroll the entire screen no
>matter where the cursor is located or are they for only when the cursor
>is on the top (sf=) and bottom (sr=) lines? Thanx for your time...

From the 4.3BSD termcap manual entry:

	In order to scroll text up, a program goes to the bottom left
	corner of the screen and sends the "sf" (index) string.  To
	scroll text down, a program goes to the top left corner of the
	screen and sends the "sr" (reverse index) string.  The strings
	"sf" and "sr" have undefined behavior when not on their
	respective corners of the screen.

peter@ficc.uu.net (Peter da Silva) (02/14/90)

In article <1831@unccvax.UUCP> cs00chs@unccvax.UUCP (charles spell) writes:
> Are the sf= and sr= entries supposed to scroll the entire screen no
> matter where the cursor is located or are they for only when the cursor
> is on the top (sf=) and bottom (sr=) lines? Thanx for your time...

In practice they seem to be defined both ways in different TERMCAP and
TERMINFO databases. The latest version of browse has been updated to work
with sf/sr that only work on the top/bottom lines.

I have another question. Most termcaps have been set up so that 'cs' to
change the scrolling region takes the top line # first. Someone sent in
a set of changes to browse that implied that for xterm windows on a SS1
the reverse is true (bottom line # first). Which is it?
-- 
 _--_|\  Peter da Silva. +1 713 274 5180. <peter@ficc.uu.net>.
/      \
\_.--._/ Xenix Support -- it's not just a job, it's an adventure!
      v  "Have you hugged your wolf today?" `-_-'

gwyn@smoke.BRL.MIL (Doug Gwyn) (02/14/90)

In article <2NQ1.H1xds13@ficc.uu.net> peter@ficc.uu.net (Peter da Silva) writes:
>I have another question. Most termcaps have been set up so that 'cs' to
>change the scrolling region takes the top line # first. Someone sent in
>a set of changes to browse that implied that for xterm windows on a SS1
>the reverse is true (bottom line # first). Which is it?

Look, guys, I went through a lot of trouble to edit the termcap manual
entry for the 4.3BSD release, bringing it up to date with respect to
terminfo at the time.  (Another update is imminent.)  I even posted it
so you would all be able to have a copy even if you don't have access
to 4.3BSD documentation.  The answers to questions like these are not
hard to figure out from the specs in the official termcap manual.

	cs	str	(NP)	Change scrolling region to lines m thru n
				(VT100)

	If the terminal has a settable scrolling region (like the VT100),
	the command to set this can be described with the "cs" capability,
	which takes two parameters: the top and bottom lines of the
	scrolling region.  The cursor position is, alas, undefined after
	using this command.

While it doesn't rub your nose in it, by analogy with similar wording
elsewhere in the termcap manual entry this certainly implies that the
first parameter (unless %r is specified) is `m' and denotes the top line
of the region, while the second (ditto) is `n' and denotes the bottom line.
Referring to the VT100 termcap that I occasionally post will confirm this:
	cs=\E[%i%d;%dr
The "xterm" termcap from X11R3 has the identical definition for "cs".
(In fact it's the ANS X3.64 definition: ESC CSI top `;' bottom `r'.)