From bcd0fd112812bc005b1908d2994a6e5686e94d6e Mon Sep 17 00:00:00 2001 From: Bart Schaefer Date: Mon, 2 Jan 2012 19:31:16 +0000 Subject: queue_signals() to prevent adjustwinsize() loop on FreeBSD --- Src/Zle/zle_main.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'Src/Zle/zle_main.c') 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(); -- cgit 1.4.1