Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!sdd.hp.com!decwrl!sgi!shinobu!odin!ramoth.esd.sgi.com!msc From: msc@ramoth.esd.sgi.com (Mark Callow) Newsgroups: comp.sys.sgi Subject: Re: wsh window size code Message-ID: <1991Apr18.183945.21088@odin.corp.sgi.com> Date: 18 Apr 91 18:39:45 GMT References: <9104170341.AA13470@karron.med.nyu.edu> Sender: news@odin.corp.sgi.com (Net News) Reply-To: msc@sgi.com Organization: Silicon Graphics Inc., Entry Systems Division Lines: 31 In article <9104170341.AA13470@karron.med.nyu.edu>, Dan Karron@UCBVAX.BERKELEY.EDU writes: |> What about cases when you are 1) not connected to a terminal, |> 2) piped to the printer, or How can the "window size" be relevant in these cases. You aren't talking to a window. I can see some need to know how wide the printer's lines are. Make a terminfo entry for the printer and see 3 below. |> 3) using termio Do you mean terminfo? The ioctl works just fine with termio. Terminfo uses the ioctl to get the value of lines and columns. If the ioctl fails then it falls back to the LINES and COLUMNS environment variables. If those don't exist it falls back to the value given in the terminal database. |> 4) using termcap Ditto with terminfo. |> 4) completely lost and need to make a best guess ! Use terminfo or curses which fall back on the value in the terminal data base. I will admit that the TIOCGETWINSZ ioctl is not clearly documented. However most of the rest of this stuff is documented in the terminfo/curses man pages. -- From the TARDIS of Mark Callow msc@ramoth.sgi.com, ...{ames,decwrl}!sgi!msc "Spirits of genius are always opposed by mediocre minds" - Albert Einstein