Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!decwrl!sgi!msc@ramoth.SGI.COM From: msc@ramoth.SGI.COM (Mark Callow) Newsgroups: comp.sys.sgi Subject: Re: Lines per Window Summary: terminal size information Message-ID: <28502@sgi.SGI.COM> Date: 12 Mar 89 01:30:08 GMT References: <262@ai.etl.army.mil> Sender: daemon@sgi.SGI.COM Distribution: usa Organization: Silicon Graphics, Inc., Mountain View, CA Lines: 31 In article <262@ai.etl.army.mil>, richr@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