From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10255 invoked from network); 10 Dec 1997 06:23:17 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 10 Dec 1997 06:23:17 -0000 Received: (from list@localhost) by math.gatech.edu (8.8.5/8.8.5) id BAA16687; Wed, 10 Dec 1997 01:06:59 -0500 (EST) Resent-Date: Wed, 10 Dec 1997 01:06:59 -0500 (EST) From: "Bart Schaefer" Message-Id: <971209220737.ZM10636@candle.brasslantern.com> Date: Tue, 9 Dec 1997 22:07:37 -0800 X-Mailer: Z-Mail (4.0b.820 20aug96) To: zsh-workers@math.gatech.edu Subject: zsh 3.0.5 WINSZ stuff is messing up my vi MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Resent-Message-ID: <"CRugg1.0.d44.26ZZq"@math> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/3648 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu 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