Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: 3.0.6-pre-4: COLUMNS/LINES environment handling



"Bart Schaefer" wrote:

> Now, somebody who has a copy of the actual POSIX shell spec should tell
> us if the above is reasonable.  Zoltan, are you out there?

I had a look at the single UNIX spec (see http://www.opengroup.org/) and it
doesn't say anything about this, at least in the Shell chapter (2).

> How much of all that needs to go in the manual?  Lots of it should go in
> the FAQ, including remarks about how it is broken in various versions if
> we can figure that out.

As it now behaves logically, the manual entry can be shortish, but it might
be nice to say a bit more about LINES and COLUMNS, e.g. that they're set
automatically if possible but may be wrong.

As for the FAQ entry, maybe inspiration will strike, but these things are
unpredictable, n'est-ce pas?

> Finally, I noticed that `winchanged' was declared only if TIOCGWINSZ but
> used without such a condition.  Apparently zsh doesn't get built on any
> systems that don't have TIOCGWINSZ?

Presumably it hasn't been (because it can't be), but this must be wrong.


This is a non-sequitur, but while I was looking at the UNIX spec I noticed
that LINENO, unlike LINES, is specified, and it says that functions as well
as scripts should have it set.  You'll find out that with autoloaded
functions you always get 0 from `print $LINENO' (the question of why is not
entirely trivial).  I've known about this for ages, but the ways I thought
about fixing it at the time were rather gross.  But maybe someone's little
grey cells...

-- 
Peter Stephenson <pws@xxxxxxxxxxxxxxxxx>       Tel: +39 050 844536
WWW:  http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy



Messages sorted by: Reverse Date, Date, Thread, Author