Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Cannot invoke widget within zpty, with \C-a nor a
- X-seq: zsh-workers 43773
- From: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: Cannot invoke widget within zpty, with \C-a nor a
- Date: Tue, 6 Nov 2018 18:08:22 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=J5h6zYjPztCYqFmuCjB5jH7Lgjdk6MoI4nViH9Tl1GI=; b=mi5wMO10hlFLNDlvDC83Vc9c8UC8jh8j3TDjq7WDxpCoM+cxa9c+O2kJtpgvLO6wB6 O9/pKfEB8cTQ9orHxMmnFAl7znhQ8HsmG1IHkpt/BNBuTcBr/p7hB4GelWRRXU+NU3vU 3+UrnYNVKLe++nzT6rzH0iFPtqgqrNOKZ56+u98CqM2i3YokhVelruWxhkWxBwG7R+Vo /hrE1gbkdKkb8zER/gVFuLh8FzsXhTKqJ3+Y2ElPSPalbsqaRWC5LmkwGZz4pYryluAN Ds/BanG6yDsSbMn5oAoGC27u559ACwBzB6Vrct+Go/FFqehrpcJldJlX7Lt9QJP1c785 AvfQ==
- In-reply-to: <CAKc7PVA5BKywt0GEgJUWcC57bFqC6emwGthZQPe2YmcnA9HFYg@mail.gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CAKc7PVA5BKywt0GEgJUWcC57bFqC6emwGthZQPe2YmcnA9HFYg@mail.gmail.com>
On Tue, 6 Nov 2018 at 16:19, Sebastian Gniazdowski
<sgniazdowski@xxxxxxxxx> wrote:
>
> Hello,
> I've attached complete test file. The test body is:
>
> zpty_start
> zpty_input 'stty 38400 columns 80 rows 24 tabs -icanon -iexten' nl
> zpty_input 'rh_widget() { BUFFER="ls"; region_highlight+=( 0 4
> "fg=#12569a" ); echo yes; }' nl
> zpty_input 'zle -N rh_widget' nl
> zpty_input 'bindkey "\C-a" rh_widget' nl
> zpty_input 'zle -la | grep rh_widget' nl
> zpty_input 'bindkey | grep rh_widget' nl
> zpty_input $'\C-a'
> zpty_stop
> 0:region_highlight
> *>*ls*
I now see that testing the running of zle widgets is in general
difficult, even with zpty. X03zlebindkey.ztst does only `-s' bindkeys,
which do not run a zle-widget, `zle && true || echo nozle' will
display "nozle". I would believe that this is lost game, as even this
didn't work as expected:
rh_widget() { local FD="$1"; zle -F -w $FD; exec {FD}<&-; BUFFER="ls";
region_highlight+=( 0 4 "fg=#12569a" ); echo yes | tee -a /tmp/reply;
}; zle -N rh_widget
FD=1337; exec {FD}< <( LANG=C sleep 0.5; echo run | tee -a /tmp/reply
); command true; zle -F -w "$FD" rh_widget
... however, it turned out that the `+Z' option passed to zsh-binary
(its meaning: disable Zle) was responsible for not interpreting any
key sequences (and not activating zle -F, however removing +Z didn't
help here actually). I now have the `rh_widget' called after zpty -w
zsh $'\C-a'.
The `region_highlight' tests (brought up because of wanting to test
true/near-color, but also revealed that general `rh' use is untested
and this rather should change) seem to be possible to write.
--
Sebastian Gniazdowski
News: https://twitter.com/ZdharmaI
IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zplugin
Blog: http://zdharma.org
Messages sorted by:
Reverse Date,
Date,
Thread,
Author