Re: RFC PATCH: fix lookup in $commands array when HASHLISTALL is unset

Mikael Magnusson <[email protected]>
Newsgroups gmane.comp.shells.zsh.devel
Message-ID <CAHYJk3Q4VyS63Juy9dHTb+837rz5cvGpYGzzJRM8HaQVXPYbuA@mail.gmail.com>
On Tue, May 26, 2026 at 7:23 PM Bart Schaefer <[email protected]> wrote:
>
> On Tue, May 26, 2026 at 8:36 AM Mikael Magnusson <[email protected]> wrote:
> >
> > Change getpmcommand to always do a lookup via findcmd() if it the entry
> > is not found in the hash and HASHLISTALL is unset. This will indirectly
> > respect HASHCMDS and add the single entry if it is set, look it up in
> > the hash if it was added and then HASHCMDS was unset, etc.
>
> This is a reasonable idea.  It'll mostly affect non-interactive use,
> though?  Because doesn't loading up compsys effectively force a
> hashlistall so the $commands array can be referenced in completers?

My git prompt immediately broke when I ran "rehash" interactively,
with the HASHLISTALL option unset. I can't find anything in
Completion/ for git grep -i hashlistall or hash_list_all. I'm not sure
what other mechanism it could be using to achieve this?

If I am in this state, then
% ls $commands[<tab>
---- no match for: `association key'

(without either of the patches in this thread)

-- 
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.