Re: [PATCH] compinit forks less

Mikael Magnusson <[email protected]>
Newsgroups gmane.comp.shells.zsh.devel
Message-ID <CAHYJk3RhWiAuZLXSXhhRrwJswsYHBR5Vs9Q_iFoWm+28TRX9Tw@mail.gmail.com>
On Thu, Apr 30, 2026 at 9:22 AM Charles Blake <[email protected]> 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.