zsh-workers
 help / color / mirror / code / Atom feed
* EOF exiting shell
@ 2001-08-14 15:24 Adam Spiers
  2001-08-14 16:04 ` Peter Stephenson
  0 siblings, 1 reply; 5+ messages in thread
From: Adam Spiers @ 2001-08-14 15:24 UTC (permalink / raw)
  To: zsh workers mailing list

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2001-08-16  9:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-14 15:24 EOF exiting shell Adam Spiers
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

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).