From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7501 invoked by alias); 16 Oct 2013 17:54:04 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 18033 Received: (qmail 717 invoked from network); 16 Oct 2013 17:53:58 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:subject:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=YqKvy9774Rt6x4EiJ12SQjy7X7DUClMlqJAlgtWbBro=; b=kdJN+BafDzmPR6d0oQT7yKjWYGux8hRuAGy4TiOqDvbdoF1Udvu/rpShjqTbdKDQmf mwAWNkMZ2ZsTo0sesnvMWnUyJL3b3hfvtcpPMAqhRo1daKs/prksjheDR5O7x8x9OYgu kTsb6lEcmg631DNsg6YinBRqP+XkLHKi7LSU7FiLvY9f84K5Prs/WDT/RbOD4mLWBSmW oub/e1UfXyqwLe8CUt1qJRAY0yS4hs61Q+mXFtqhIbGcBIgGEDwAIorBXIgWbSRsl30z X1M1g/u9ZmlZSHB7QDA3EpMpkT2FlLsDURBlrb/pX7k19aHg182xzK/WiWE9eUpqfULN uMww== X-Gm-Message-State: ALoCoQlUjst+/h/q2o9KM9DZMcYn13N1ek1cL3brtH8jVVNu+6Wau+O3Irj+9JW6TDYGvQDr/uGp X-Received: by 10.15.73.130 with SMTP id h2mr6407653eey.56.1381946034089; Wed, 16 Oct 2013 10:53:54 -0700 (PDT) X-ProxyUser-IP: 86.6.157.246 Date: Wed, 16 Oct 2013 18:53:51 +0100 From: Peter Stephenson To: zsh-users@zsh.org Subject: Re: process substitution bug with set -e? Message-ID: <20131016185351.7dfa7d7e@pws-pc.ntlworld.com> In-Reply-To: <131015072947.ZM1984@torch.brasslantern.com> References: <20131014124126.GA31070@ypig.lip.ens-lyon.fr> <20131014144838.6ec034dd@pwslap01u.europe.root.pri> <20131014150845.GB31070@ypig.lip.ens-lyon.fr> <20131014172854.70e2c3ce@pwslap01u.europe.root.pri> <131014104749.ZM591@torch.brasslantern.com> <20131015094248.1cb9611d@pwslap01u.europe.root.pri> <131015072947.ZM1984@torch.brasslantern.com> X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.7; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Tue, 15 Oct 2013 07:29:47 -0700 Bart Schaefer wrote: > I think we should be able to say something more general about the behavior > of "exit" with respect to asynchronous jobs, and that ERR_EXIT has the > same behavior. There's a little about this in the "Jobs" section but it > only references explicitly backgrounded jobs and the HUP signal/option, > not about implicitly asynchronous jobs. > > For example, note that multios and process substitutions are "disowned" > in the sense that they don't get HUP'd (they also don't get TTOU'd, but > aren't able to read from the terminal as far as I can tell [I/O error]). Please provide any further patches that seem a good idea on top of this. diff --git a/Doc/Zsh/builtins.yo b/Doc/Zsh/builtins.yo index 2cc33d2..1d9fe68 100644 --- a/Doc/Zsh/builtins.yo +++ b/Doc/Zsh/builtins.yo @@ -595,6 +595,11 @@ is specified, use the exit status from the last command executed. pindex(IGNORE_EOF, use of) An EOF condition will also cause the shell to exit, unless the tt(IGNORE_EOF) option is set. + +See notes at the end of +ifzman(the section JOBS in in zmanref(zshmisc))\ +ifnzman(noderef(Jobs & Signals)) for some possibly unexpected interactions +of the tt(exit) command with jobs. ) findex(export) item(tt(export) [ var(name)[tt(=)var(value)] ... ])( diff --git a/Doc/Zsh/jobs.yo b/Doc/Zsh/jobs.yo index 3baf77f..d939501 100644 --- a/Doc/Zsh/jobs.yo +++ b/Doc/Zsh/jobs.yo @@ -115,3 +115,18 @@ The shell itself always ignores the tt(QUIT) signal. Otherwise, signals have the values inherited by the shell from its parent (but see the tt(TRAP)var(NAL) special functions in noderef(Functions)). + +cindex(exiting shell, and asynchronous jobs) +cindex(asynchronous jobs, and exiting shell) +cindex(jobs, asynchronous, and exiting shell) +Certain jobs are run asynchronously by the shell other than those +explicitly put into the background; even in cases where the shell +would usually wait for such jobs, an explicit tt(exit) command +or exit due to the option tt(ERR_EXIT) will cause the shell to +exit without waiting. Examples of such asynchronous jobs are +process substitution, see +ifzman(the section PROCESS SUBSTITUTION in the zmanref(zshexpn) manual page)\ +ifnzman(noderef(Process Substitution)), and the handler processes for +multios, see +ifzman(the section MULTIOS in the zmanref(zshmisc) manual page)\ +ifnzman(the section Multios in noderef(Redirection)). diff --git a/Doc/Zsh/options.yo b/Doc/Zsh/options.yo index 9055215..3c6ea63 100644 --- a/Doc/Zsh/options.yo +++ b/Doc/Zsh/options.yo @@ -1553,6 +1553,11 @@ the trap. If the option tt(DEBUG_BEFORE_CMD) is set, as it is by default, and the option tt(ERR_EXIT) is found to have been set on exit, then the command for which the tt(DEBUG) trap is being executed is skipped. The option is restored after the trap exits. + +Exiting due to tt(ERR_EXIT) has certain interactions with asynchronous +jobs noted in +ifzman(the section JOBS in in zmanref(zshmisc))\ +ifnzman(noderef(Jobs & Signals)). ) pindex(ERR_RETURN) pindex(NO_ERR_RETURN) -- Peter Stephenson Web page now at http://homepage.ntlworld.com/p.w.stephenson/