about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBart Schaefer <barts@users.sourceforge.net>2012-01-02 19:31:16 +0000
committerBart Schaefer <barts@users.sourceforge.net>2012-01-02 19:31:16 +0000
commitbcd0fd112812bc005b1908d2994a6e5686e94d6e (patch)
tree4b2709c1297e75e951d5a36e5ab95da3ad73b47d
parentea7e24879fe3e7bf59b4373708158d5c973282a6 (diff)
downloadzsh-bcd0fd112812bc005b1908d2994a6e5686e94d6e.tar.gz
zsh-bcd0fd112812bc005b1908d2994a6e5686e94d6e.tar.xz
zsh-bcd0fd112812bc005b1908d2994a6e5686e94d6e.zip
queue_signals() to prevent adjustwinsize() loop on FreeBSD
-rw-r--r--ChangeLog8
-rw-r--r--Src/Zle/zle_main.c14
2 files changed, 21 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 0afa5b3b8..b90d698aa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2012-01-02  Barton E. Schaefer  <schaefer@zsh.org>
+
+	* 30073 (plus comment): Src/Zle/zle_main.c: use queue_signals()
+	around critical first call to zrefresh() after zleactive = 1, to
+	prevent adjustwinsize() loop reported on FreeBSD.
+
 2011-12-30  Frank Terbeck  <ft@bewatermyfriend.org>
 
 	* 30048: Test/C02cond.ztst: Avoid [[ -N ... ]] on file-systems
@@ -15804,5 +15810,5 @@
 
 *****************************************************
 * This is used by the shell to define $ZSH_PATCHLEVEL
-* $Revision: 1.5551 $
+* $Revision: 1.5552 $
 *****************************************************
diff --git a/Src/Zle/zle_main.c b/Src/Zle/zle_main.c
index 3cdc3b2ed..e570d1d8c 100644
--- a/Src/Zle/zle_main.c
+++ b/Src/Zle/zle_main.c
@@ -1200,6 +1200,18 @@ zleread(char **lp, char **rp, int flags, int context)
 	putc('\r', shout);
     if (tmout)
 	alarm(tmout);
+
+    /*
+     * 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();
+
     zleactive = 1;
     resetneeded = 1;
     errflag = retflag = 0;
@@ -1209,6 +1221,8 @@ zleread(char **lp, char **rp, int flags, int context)
 
     zrefresh();
 
+    unqueue_signals();	/* Should now be safe to acknowledge SIGWINCH */
+
     zlecallhook("zle-line-init", NULL);
 
     zlecore();