zsh-workers
 help / color / mirror / code / Atom feed
From: "Bart Schaefer" <schaefer@brasslantern.com>
To: zsh-workers@math.gatech.edu
Subject: zsh 3.0.5 WINSZ stuff is messing up my vi
Date: Tue, 9 Dec 1997 22:07:37 -0800	[thread overview]
Message-ID: <971209220737.ZM10636@candle.brasslantern.com> (raw)

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


                 reply	other threads:[~1997-12-10  6:23 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=971209220737.ZM10636@candle.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-workers@math.gatech.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).