Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH 1/2] zle: Make sure state changes are refreshed after init hook
- X-seq: zsh-workers 31483
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: Frank Terbeck <ft@xxxxxxxxxxxxxxxxxxx>
- Subject: Re: [PATCH 1/2] zle: Make sure state changes are refreshed after init hook
- Date: Mon, 17 Jun 2013 16:53:13 +0200
- Cc: zsh workers <zsh-workers@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=oOqn/3Sxui73paboA2UAMYcUYXUeR257/OV6neGKSRc=; b=rNn7VVLGRW3Agq3Z0w+OT3uV1FPKdfidjVkFAVr/HcBl25kSGGbfskoVOVCLqlu/TW wpIRUuVxBMPjrcWayAvus9kFJpCWqvMi8eThDJAzEX61IJ0JGB2LVy61r5DixBi0+kJJ pKzJD2l2lHpFWNNvsecCD4DZBrwRmfwglEQQHr4zYvzJb4juV783mgHfOI2dxKzhp5nX Fe2SCWKVuNF1CCw7B6mZ7fOir/4XWCPvWm5ZbF82dfWzDTrNSiKO3FDPnfmSQBIglxAt pOvvLjc2T9TCunk34o7Lsw3GDtVq7iEmG+gYxirEnsSc9dEr9a6Kkj49AJN/4wlRTQZw sdzA==
- In-reply-to: <1364049998-22603-2-git-send-email-ft@bewatermyfriend.org>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <1364049998-22603-1-git-send-email-ft@bewatermyfriend.org> <1364049998-22603-2-git-send-email-ft@bewatermyfriend.org>
This patch causes a hang on startup with this .zshrc
zle -N zle-line-init foo
zle -N set-local-history bar
foo() { zle set-local-history -n 1 }
bar() { zle reset-prompt }
This patch fixes it, see also the commit a ways above,
/*
* 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
*/
@@ -1229,6 +1229,8 @@
initmodifier(&zmod);
prefixflag = 0;
+ zrefresh();
+
unqueue_signals(); /* Should now be safe to acknowledge SIGWINCH */
zlecallhook(init, NULL);
On 23 March 2013 15:46, Frank Terbeck <ft@xxxxxxxxxxxxxxxxxxx> wrote:
> If `zrefresh' is not called _after_ the zle-line-init hook, any changes
> made to the editor's state (be it changes to $CURSOR or $BUFFER or
> called widgets like `clear-screen') will only be picked up after the
> first character is typed into the editor.
> ---
> Src/Zle/zle_main.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/Src/Zle/zle_main.c b/Src/Zle/zle_main.c
> index e1a575b..5157ad3 100644
> --- a/Src/Zle/zle_main.c
> +++ b/Src/Zle/zle_main.c
> @@ -1219,12 +1219,12 @@ zleread(char **lp, char **rp, int flags, int context)
> initmodifier(&zmod);
> prefixflag = 0;
>
> - zrefresh();
> -
> unqueue_signals(); /* Should now be safe to acknowledge SIGWINCH */
>
> zlecallhook("zle-line-init", NULL);
>
> + zrefresh();
> +
> zlecore();
>
> if (errflag)
> --
> 1.8.2.rc1
>
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author