From: Adam Spiers <adam@spiers.net>
To: zsh workers mailing list <zsh-workers@sunsite.auc.dk>
Subject: EOF exiting shell
Date: Tue, 14 Aug 2001 16:24:04 +0100 [thread overview]
Message-ID: <20010814162404.A6900@thelonious.new.ox.ac.uk> (raw)
Two queries regarding exiting the shell via ^D:
- The info pages say that even if IGNOREEOF is set, the shell will
exit after ten EOFs, but in zle_main.c it looks like it needs to
happen 20 times (although for me it never exits with IGNOREEOF set).
- More importantly, if you exit via EOF, it exits with the last
value of $? as the exit code. This may be deliberate, but it's
quite annoying for me; I have /bin/sh as my default shell, and
then this gets called by my .bash_profile:
switch_shell () {
if [ -x $MYSHELL ] && [ -z "$NO_ZSH" ]; then
# we do this rather than exec() just in case $MYSHELL fails to
run.
$MYSHELL -d "$@" && exit
fi
}
where $MYSHELL points to a CVS install of zsh, which could
conceivably be broken. This way I guarantee myself a usable shell
without some annoying `Run zsh [Y/n]?' sort of prompt every time I
pop up a new terminal. However, if in the successfully invoked
zsh I hit ^D after doing something that sets $? != 0, that means
that I fall back into bash. No great hardship, but would be nice
if it didn't happen. Is there any reason why EOF couldn't set $?
to 0 before exiting?
Thanks,
Adam
next reply other threads:[~2001-08-14 15:24 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-08-14 15:24 Adam Spiers [this message]
2001-08-14 16:04 ` Peter Stephenson
2001-08-15 18:49 ` Peter Stephenson
2001-08-16 2:16 ` Bart Schaefer
2001-08-16 9:36 ` Peter Stephenson
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=20010814162404.A6900@thelonious.new.ox.ac.uk \
--to=adam@spiers.net \
--cc=zsh-workers@sunsite.auc.dk \
/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).