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

zsh 3.0.5 WINSZ stuff is messing up my vi



My email program starts an editor with "xterm -geometry 80x48 -e vi ...".
If I subsequently run any shell command from that editor (e.g. "!Gfmt -72"),
zsh forces the terminal size to 80x24, which then messes up the vi session.

I compared strace output for zsh-3.0.4 and zsh-3.0.5 and the interesting
diff is that zsh-3.0.5 -c calls ioctl(TIOCSWINSZ), even with both stdin
and stdout redirected:

ioctl(10, TIOCSWINSZ, {ws_row=48, ws_col=80, ws_xpixel=480, ws_ypixel=624}) = 0
ioctl(10, TIOCGWINSZ, {ws_row=48, ws_col=80, ws_xpixel=480, ws_ypixel=624}) = 0
ioctl(10, TIOCSWINSZ, {ws_row=48, ws_col=80, ws_xpixel=480, ws_ypixel=624}) = 0
ioctl(10, TIOCGWINSZ, {ws_row=48, ws_col=80, ws_xpixel=480, ws_ypixel=624}) = 0

(The output above shows ws_row=48 because I ran it from within another shell
that already had the window size set correctly.)

zsh -fc does not TIOCSWINSZ in either version, but 3.0.5 performs TIOCGWINSZ
five times for 3.0.4's once.

I think the problem may be that adjustwinsize(0) is being called before all
the opts[] values have been properly initialized, which makes it think that
zsh is interactive -- but I haven't yet tracked it down.

I can mail strace output if necessary, but it's easily seen with

  strace zsh -c exit < /dev/null 2>&1 | grep WINSZ

If instead I run

  (unset LINES COLUMNS ; strace zsh -c exit < /dev/null 2>&1 | grep WINSZ)

then I get identical behavior from zsh-3.0.4 and 3.0.5 -- so I suspect it
has something to do with the new code to import LINES and COLUMNS when
they are set.  In the case of "xterm -geometry ..." any LINES or COLUMNS
in the environment are completely irrelevant; but the real bug is that zsh
isn't properly detecting that it is NOT interactive.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com



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