wsh window size code

Mark Callow msc at ramoth.esd.sgi.com
Fri Apr 19 04:39:45 AEST 1991


In article <9104170341.AA13470 at karron.med.nyu.edu>, Dan Karron at 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 at ramoth.sgi.com, ...{ames,decwrl}!sgi!msc
"Spirits of genius are always opposed by mediocre minds" - Albert Einstein



More information about the Comp.sys.sgi mailing list