zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: "Yuri D'Elia" <wavexx@users.sourceforge.net>
Cc: zsh-workers@zsh.org
Subject: Re: precmd: write error: interrupted
Date: Sat, 27 Apr 2013 15:31:41 -0700	[thread overview]
Message-ID: <130427153141.ZM20125@torch.brasslantern.com> (raw)
In-Reply-To: <517C0E09.4040505@users.sourceforge.net>

[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.


  parent reply	other threads:[~2013-04-27 22:32 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <klbmnc$ieh$1@ger.gmane.org>
     [not found] ` <130425111646.ZM17258@torch.brasslantern.com>
     [not found]   ` <klc0n1$34u$1@ger.gmane.org>
2013-04-26  0:53     ` Bart Schaefer
     [not found]   ` <20130425193817.2f82b60c@pws-pc.ntlworld.com>
     [not found]     ` <130425151839.ZM17476@torch.brasslantern.com>
2013-04-26  8:42       ` Peter Stephenson
     [not found]   ` <klc2ah$jiv$1@ger.gmane.org>
     [not found]     ` <130426080805.ZM18619__18102.73175729$1366989065$gmane$org@torch.brasslantern.com>
2013-04-26 17:59       ` Yuri D'Elia
     [not found]     ` <130426080805.ZM18619@torch.brasslantern.com>
     [not found]       ` <517C0E09.4040505@users.sourceforge.net>
2013-04-27 22:31         ` Bart Schaefer [this message]
2013-04-28 15:30           ` Yuri D'Elia
2013-04-29  1:03             ` Bart Schaefer
2013-04-29  1:59               ` Bart Schaefer
2013-05-05  0:01               ` Frank Terbeck
2013-05-05  6:52                 ` Bart Schaefer
2013-05-05  9:38                   ` Frank Terbeck
2013-05-05 17:53                     ` Bart Schaefer
2013-05-05 18:37                       ` Frank Terbeck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=130427153141.ZM20125@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=wavexx@users.sourceforge.net \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).