Lines per Window

Mark Callow msc at ramoth.SGI.COM
Sun Mar 12 11:30:08 AEST 1989


In article <262 at ai.etl.army.mil>, richr at ai.etl.army.mil (Richard Rosenthal) writes:
> How does "more" program know how many lines in 4Sight window?
> 
> Apparently not from termcap ...  iris-ansii says 40 lines, but,
> if I shrink the window to only 4 or 5 lines more still works
> fine.
> 
> I want to make "less" work like this, too.  "less" seems to only
> use termcap.
> 

wsh sets the size in the kernel using the bsd TIOCSWINSZ ioctl.  Terminfo
and curses retrieve this information using the TIOCGWINSZ ioctl.  Any
program using curses or terminfo (e.g. more, ls, vi) works quite well.
The version of less that I'm using works just fine.

The algorithm in terminfo is as follows:

	set lines and columns from terminfo database
	if (TIOCGWINSZ)
		override lines and columns with ioctl data
	if (getenv(LINES))
		override lines with environment value
	if (getenv(COLUMNS))
		override columns with environment value

We don't have termcap on the 4D (other than the libtermcap emulation provided
by terminfo) so either you are on a 3xxx or you've provided your own termcap.
For the 3xxx simply replace terminfo with termcap in the above algorithm.
--
	-Mark



More information about the Comp.sys.sgi mailing list