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

Re: Possible bug: HASH_CMDS has no observable effect



On Sat, Sep 12, 2020 at 10:41 PM Bart Schaefer
<schaefer@xxxxxxxxxxxxxxxx> wrote:
>
> That's exactly how it works.  The search in execute() is only done if
> an absolute file location for the command isn't provided by the
> parent, which only occurs if HASH_CMDS is not set.

This is what I expected to happen but that's not what actually
happens. Sometimes, when HASH_CMDS is set, a successfully invoked
command does not get hashed.

Here's a new test case that doesn't use docker.

  % zsh -f
  % mkdir /tmp/foo
  % path+=(/tmp/foo)
  % print $+commands[bar]
  0
  % print 'echo hello' >/tmp/foo/bar
  % chmod +x /tmp/foo/bar
  % bar
  hello
  % print $+commands[bar]
  0

The output of the last command should be "1", right? Everything else
looks as expected.

Roman.




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