From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4837 invoked from network); 14 Aug 2001 15:24:14 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 14 Aug 2001 15:24:14 -0000 Received: (qmail 19335 invoked by alias); 14 Aug 2001 15:24:06 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 15625 Received: (qmail 19324 invoked from network); 14 Aug 2001 15:24:05 -0000 Date: Tue, 14 Aug 2001 16:24:04 +0100 From: Adam Spiers To: zsh workers mailing list Subject: EOF exiting shell Message-ID: <20010814162404.A6900@thelonious.new.ox.ac.uk> Reply-To: Adam Spiers Mail-Followup-To: zsh workers mailing list Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i X-Home-Page: http://www.new.ox.ac.uk/~adam/ X-OS: RedHat Linux 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