zsh-workers
 help / color / mirror / code / Atom feed
From: Mikael Magnusson <mikachu@gmail.com>
To: Frank Terbeck <ft@bewatermyfriend.org>
Cc: zsh workers <zsh-workers@zsh.org>
Subject: Re: [PATCH 1/2] zle: Make sure state changes are refreshed after init hook
Date: Mon, 17 Jun 2013 16:53:13 +0200	[thread overview]
Message-ID: <CAHYJk3TWyqripJgdJyK82Upca_ZeQVVVLk=DJKy37E2oNdKQpg@mail.gmail.com> (raw)
In-Reply-To: <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@bewatermyfriend.org> 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


  reply	other threads:[~2013-06-17 14:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-23 14:46 [PATCH 0/2] Custom init and finish hooks with vared Frank Terbeck
2013-03-23 14:46 ` [PATCH 1/2] zle: Make sure state changes are refreshed after init hook Frank Terbeck
2013-06-17 14:53   ` Mikael Magnusson [this message]
2013-03-23 14:46 ` [PATCH 2/2] Let vared define custom init and finish hooks Frank Terbeck
2013-03-23 17:07 ` [PATCH 3/2] Add documentation for the new -i and -f options of vared 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='CAHYJk3TWyqripJgdJyK82Upca_ZeQVVVLk=DJKy37E2oNdKQpg@mail.gmail.com' \
    --to=mikachu@gmail.com \
    --cc=ft@bewatermyfriend.org \
    --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).