From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9084 invoked from network); 29 Jun 2002 17:17:54 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 29 Jun 2002 17:17:54 -0000 Received: (qmail 6679 invoked by alias); 29 Jun 2002 17:17:49 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 17381 Received: (qmail 6658 invoked from network); 29 Jun 2002 17:17:47 -0000 From: "Bart Schaefer" Message-Id: <1020629171715.ZM8921@candle.brasslantern.com> Date: Sat, 29 Jun 2002 17:17:15 +0000 In-Reply-To: <20020629123440.A28494@corelli.new.ox.ac.uk> Comments: In reply to Adam Spiers "broken pipe with prompt -h" (Jun 29, 12:34pm) References: <20020629123440.A28494@corelli.new.ox.ac.uk> X-Mailer: Z-Mail (5.0.0 30July97) To: Adam Spiers , zsh-workers@sunsite.dk Subject: Re: broken pipe with prompt -h MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Jun 29, 12:34pm, Adam Spiers wrote: } Subject: broken pipe with prompt -h } } $ prompt -h adam2 | grep -q plain } set_prompt:52: write error: broken pipe } set_prompt:53: write error: broken pipe This is a result of the changes in zsh-workers/16503 to cause bin_print() to report write errors. There was a follow-on patch in 16556 to suppress the errors when stdout is closed. EPIPE might be another error worthy of suppression. } I tried to fix this with a } } trap '' PIPE } } just after the 'setopt localtraps' in set_prompt and in various other } places, but it only occasionally works, which is very curious. Trapping SIGPIPE doesn't prevent errno from being set to EPIPE on the write failure, it just prevents the process from getting signaled when the EPIPE occurs. } Can anyone please tell me the correct fix? Other than redirecting stderr, I don't think there is one. It'd be the right idea to do trap 'ERRNO=0' PIPE but ERRNO is read-only. -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net