From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8472 invoked by alias); 27 Sep 2014 23:56:15 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 33259 Received: (qmail 10067 invoked from network); 27 Sep 2014 23:56:13 -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=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 From: Bart Schaefer Message-id: <140927165554.ZM32155@torch.brasslantern.com> Date: Sat, 27 Sep 2014 16:55:54 -0700 In-reply-to: <20140927214035.7af22023@pws-pc.ntlworld.com> Comments: In reply to Peter Stephenson "Re: SIGPIPE (Re: ZSH history not saved anymore)" (Sep 27, 9:40pm) References: <87mw9qdp7s.fsf@thinkpad-t440p.tsdh.org> <20140924200710.2f764272@pws-pc.ntlworld.com> <8738bg2n1v.fsf@thinkpad-t440p.tsdh.org> <140926000448.ZM30835@torch.brasslantern.com> <878ul6lrw9.fsf@thinkpad-t440p.tsdh.org> <87y4t66td0.fsf@thinkpad-t440p.tsdh.org> <871tqxqyil.fsf@thinkpad-t440p.tsdh.org> <140927105301.ZM31550@torch.brasslantern.com> <20140927214035.7af22023@pws-pc.ntlworld.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org Subject: Re: SIGPIPE (Re: ZSH history not saved anymore) MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Sep 27, 9:40pm, Peter Stephenson wrote: } Subject: Re: SIGPIPE (Re: ZSH history not saved anymore) } } On Sat, 27 Sep 2014 10:53:01 -0700 } Bart Schaefer wrote: } > I'm a bit hesitant to change this after all these years, but perhaps an } > interactive shell should exit on SIGPIPE if the terminal is not still open? } } It's hard to see how can that be wrong if we exit on EOF on the terminal. Ideally we'd know what descriptor caused the SIGPIPE and only exit if it was the terminal. isatty(SHTTY) is a crude approximation. } > I'm probably missing something having to do with subshells receiving the } > PIPE signal. } } I don't know what it is that stops it running zexit() and having the } same effect in a subshell, hence writing out history incorrectly, if } that's what you mean, but you may be thinking of something more subtle. Usually a SIGPIPE is generated by a write on a descriptor whose "other end" is closed. So I'm wondering if there are cases where a subshell might get a SIGPIPE on write, in which not only should it not zexit() but it shouldn't exit at all?