zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Roman Perepelitsa <roman.perepelitsa@gmail.com>
Cc: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: Possible bug: HASH_CMDS has no observable effect
Date: Sun, 13 Sep 2020 15:24:18 -0700	[thread overview]
Message-ID: <CAH+w=7bhu1OrLw=7KcE3M07qDA=MHqkxPADUWJz6j6gHAjHtfw@mail.gmail.com> (raw)
In-Reply-To: <CAN=4vMp4nkPQ9GrHNyDC4_qijrdfiuSmm-aE-AC_vOi1LjkvBA@mail.gmail.com>

On Sun, Sep 13, 2020 at 2:31 AM Roman Perepelitsa
<roman.perepelitsa@gmail.com> wrote:
>
> 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.

Ah ... recall that several messages back, I wrote:
> A complication of this is that the completion system also invokes
> command hashing in order to be able to use the $commands associative
> array.  So if you use completion at all, you might also find that
> command (re)hashing works differently than in a "zsh -f" shell.

I forgot that even with zsh -f, interactive shells load the
zsh/compctl and zsh/complete modules.

Those are causing the $commands hash to be immediately repopulated as
soon as $path is changed, and HASH_DIRS is also set by default, so
further updates to the hash table do not occur.  If you were to create
/tmp/foo/bar before adding /tmp/foo to the path, you would see what
you expect.

It appears that throughout this thread I've been conflating the
command being "not found" by correction [spckword()] with the command
being "not found" by execute().  Sorry about that.


      reply	other threads:[~2020-09-13 22:24 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-11  8:21 Roman Perepelitsa
2020-09-11 14:48 ` Phil Pennock
2020-09-11 15:01   ` Roman Perepelitsa
2020-09-11 16:10     ` Phil Pennock
2020-09-11 16:33       ` Roman Perepelitsa
2020-09-11 21:10         ` Bart Schaefer
2020-09-12  7:02           ` Roman Perepelitsa
2020-09-12  8:35             ` Bart Schaefer
2020-09-12  8:49               ` Roman Perepelitsa
2020-09-12 20:41                 ` Bart Schaefer
2020-09-12 20:43                   ` Bart Schaefer
2020-09-13  9:31                   ` Roman Perepelitsa
2020-09-13 22:24                     ` Bart Schaefer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAH+w=7bhu1OrLw=7KcE3M07qDA=MHqkxPADUWJz6j6gHAjHtfw@mail.gmail.com' \
    --to=schaefer@brasslantern.com \
    --cc=roman.perepelitsa@gmail.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).