Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [PATCH] compinit forks less



On Thu, Apr 30, 2026 at 9:22 AM Charles Blake <charlechaud@xxxxxxxxx> wrote:
>
> This patch to use non-forking command substitution with a here-string
> to analyze `bindkey`.  I've been using it a while with no trouble.
>
> Admittedly, a new zsh/zparameter $bindkeys associative array would be
> nicer still to introspect key bindings (rather than parsing piped
> builtin output).  That's also more work and the way of this patch
> also helps show the new non-forking command substitution if there is
> interest in doing that.

Such an array would have to be in the zsh/zle module since that's
where the data is, I think? Either way, I'm not sure what a parameter
api would look like to get the key binding for a specified key in a
specific keymap (two different keys)? Maybe some silly shenanigans
with namespaces, like ${.zle_keybinds.emacs['^I']}, but it also
doesn't map super well to how many different ways you can specify that
key (C-i, ^I, a literal ctrl-i byte, etc?).

Anyway, the patch works for me too, and I checked with strace that it
doesn't fork just to make sure.

-- 
Mikael Magnusson




Messages sorted by: Reverse Date, Date, Thread, Author