From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16196 invoked by alias); 26 Apr 2013 00:53:47 -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: 31332 Received: (qmail 11215 invoked from network); 26 Apr 2013 00:53:46 -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 Received-SPF: none (ns1.primenet.com.au: domain at closedmail.com does not designate permitted sender hosts) From: Bart Schaefer Message-id: <130425175341.ZM17766@torch.brasslantern.com> Date: Thu, 25 Apr 2013 17:53:41 -0700 In-reply-to: Comments: In reply to "Yuri D'Elia" "Re: precmd: write error: interrupted" (Apr 25, 9:38pm) References: <130425111646.ZM17258@torch.brasslantern.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org, "Yuri D'Elia" , zsh-users@zsh.org Subject: Re: precmd: write error: interrupted MIME-version: 1.0 Content-type: text/plain; charset=us-ascii (Redirecting this to -workers, so Yuri Cc'd in case he's only on -users) On Apr 25, 9:38pm, Yuri D'Elia wrote: } } precmd() { { print x } 2>/dev/null } } } still doesn't suppress the error. Interesting! Something is restoring the stderr descriptors before the error message in bin_print is written. Here is a bit of strace from 'zsh -f' with { print -n $'x\r' } 2>/devnull running in a loop on the command line (not from a precmd): open("/dev/null", O_WRONLY|O_CREAT|O_NOCTTY|O_TRUNC|O_LARGEFILE, 0666) = 3 dup2(3, 2) = 2 write(1, "x\r", 2) = ? ERESTARTSYS (To be restarted) --- SIGWINCH (Window changed) @ 0 (0) --- dup2(12, 2) = 2 dup2(11, 2) = 2 write(10, "\33[1m\33[7m%\33[27m\33[1m\33[0m \r \r", 105) = 105 write(2, "print: write error: interrupt\n", 30) = 30 Those dup2 calls should happen only at the end of execcmd after bin_print has already returned, but somehow they appear to be happening after the signal handler is called but before the error message. Attaching with a debugger blocks the interrupt so I haven't been able to stack-trace the source of the dup2 calls.