From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28977 invoked by alias); 27 Apr 2013 22:32:11 -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: 31345 Received: (qmail 2633 invoked from network); 27 Apr 2013 22:31: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=-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: <130427153141.ZM20125@torch.brasslantern.com> Date: Sat, 27 Apr 2013 15:31:41 -0700 In-reply-to: <517C0E09.4040505@users.sourceforge.net> Comments: In reply to "Yuri D'Elia" "Re: precmd: write error: interrupted" (Apr 27, 7:42pm) References: <130425111646.ZM17258@torch.brasslantern.com> <130426080805.ZM18619@torch.brasslantern.com> <517C0E09.4040505@users.sourceforge.net> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: "Yuri D'Elia" Subject: Re: precmd: write error: interrupted Cc: zsh-workers@zsh.org MIME-version: 1.0 Content-type: text/plain; charset=us-ascii [Cc'ing -workers] On Apr 27, 7:42pm, Yuri D'Elia wrote: } Subject: Re: precmd: write error: interrupted } } Just for my information, is there something I should do for these 2 } issues (redirection and SIGWINCH); ie: file a bug report somewhere so it } doesn't get forgotten? The mailing list is the place to file bug reports, so for the moment you have done as much as you can ... } I've seen this error for too long to let it go :) The WINCH bug was tickling a memory so I went looking through the source for mentions of SIGWINCH and found this in zle_main.c:zlread(): /* * On some windowing systems we may enter this function before the * terminal is fully opened and sized, resulting in an infinite * series of SIGWINCH when the handler prints the prompt before we * have done so here. Therefore, hold any such signal until the * first full refresh has completed. The important bit is that the * handler must not see zleactive = 1 until ZLE really is active. * See the end of adjustwinsize() in Src/utils.c */ queue_signals(); What you've been reporting is almost certainly another variation of the same bug. So maybe all we really need is this (plus some #ifdef): diff --git a/Src/utils.c b/Src/utils.c index 26e2a5c..a20a5e1 100644 --- a/Src/utils.c +++ b/Src/utils.c @@ -1323,7 +1323,9 @@ preprompt(void) /* If a shell function named "precmd" exists, * * then execute it. */ + signal_block(signal_mask(SIGWINCH)); /* See zleread() */ callhookfunc("precmd", NULL, 1, NULL); + signal_unblock(signal_mask(SIGWINCH)); if (errflag) return; There are a couple of other things in preprompt() that might want this kind of wrapper too, e.g. periodic and the prepromptfns array, but we can start with checking if the above is helpful.