instability in Berkeley versus AT&T releases (absurdly long)

Mark Horton mark at cbosgd.UUCP
Mon Aug 12 09:45:53 AEST 1985


In article <553 at brl-tgr.ARPA> gwyn at brl-tgr.ARPA (Doug Gwyn <gwyn>) writes:
>> Actually, the SVR2 ls -C looks at the COLUMNS variable to find out how much
>> space is available, and adjusts the number of columns accordingly.
>
>Columnators should also do an ioctl(TIOCGWINSZ) or the DMD equivalent.
>Our "mpx" does not alter the COLUMNS environment variable for each
>layer, but rather stores the window size in the tty structure.

It doesn't really look directly at COLUMNS.  It calls setupterm and
looks at columns, which setupterm sets.  Setupterm (a standard low
level terminfo routine) checks for COLUMNS, does the proper ioctls
(JWINSIZE for the 5620, TIOGCSIZE for Sun, and presumably TIOCGWINSZ
for the 7300, and then looks at the terminfo database.  Given the
lack of standardization of this important ioctl, software should
not call this, but let setupterm do it for you.  Termcap based systems
should let tgetnum do the same thing, as happens on the Sun.

>It is very easy to make up a shell function, alias, or script like
>	l(){
>	ls -Cf $*;
>	}
>to make your own personalized "l" command if you want one.
>
>Default command behavior should be simple, with complexities reserved
>for the options.

In fact, this is what I do.  However, your last sentence is important.
I agree with what it says, not with what you meant.  "simple" may be
different depending on whose viewpoint you take.  From the implementers
viewpoint, it's simpler to have it run down the left margin.  From the
novice user's viewpoint, it's simpler to have it appear in columns on
the side of the screen than to (a) learn to lunge for ^S before it runs
off the screen, (b) remember to type -C every time, or (c) learn how to
make a .profile that contains the function.

	Mark



More information about the Comp.unix.wizards mailing list