Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Possible bug: HASH_CMDS has no observable effect
- X-seq: zsh-workers 47380
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx>
- Subject: Re: Possible bug: HASH_CMDS has no observable effect
- Date: Sun, 13 Sep 2020 15:24:18 -0700
- Archived-at: <https://zsh.org/workers/47380>
- Archived-at: <http://www.zsh.org/sympa/arcsearch_id/zsh-workers/2020-09/CAH%2Bw%3D7bhu1OrLw%3D7KcE3M07qDA%3DMHqkxPADUWJz6j6gHAjHtfw%40mail.gmail.com>
- Authentication-results: zsh.org; iprev=pass (mail-ot1-f42.google.com) smtp.remote-ip=209.85.210.42; dkim=pass header.d=brasslantern-com.20150623.gappssmtp.com header.s=20150623 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ZLpn5kE2PAgni0MbbpbBpqJpcm58avjTpJfzlemDvCc=; b=PtvyImUrhLbXc0Co4YKOK7WNTvlrwbHtq4jEi/RaSEHeECBSfSJm/QSUY/xjKurnoH v9vn1Xn7ZX/xhBi8zGfnnjBHpBE527OfTS7o/5GAJ7GwYzDXblStzOdiCaPTkegubOXz rnklzyQxW82FIp3i0igSvhCgbS7hfon0exMnIX9jvRheloN8G21KRQWPBfHq1uZc5rrc 10PXbSPnN4Xdmd2QQgucg0G+bo2/UDMcRG7RfsT0tJGMdJleGfbKCjzAjXEhdZKffeSA GpWq7N8JP+ljb/+Q0pPdQUcGLZiukzWf1CuDAe9CNENGhRkKcKveJjnUX5G2DDDddN7D hF7g==
- In-reply-to: <CAN=4vMp4nkPQ9GrHNyDC4_qijrdfiuSmm-aE-AC_vOi1LjkvBA@mail.gmail.com>
- List-archive: <http://www.zsh.org/sympa/arc/zsh-workers>
- List-help: <mailto:sympa@zsh.org?subject=help>
- List-id: <zsh-workers.zsh.org>
- List-owner: <mailto:zsh-workers-request@zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-subscribe: <mailto:sympa@zsh.org?subject=subscribe%20zsh-workers>
- List-unsubscribe: <mailto:sympa@zsh.org?subject=unsubscribe%20zsh-workers>
- References: <CAN=4vMqM-2Vu0n+QTbA9B_9z=3DKDdiOKbDRRaGGOG2rbY7-jA@mail.gmail.com> <20200911144852.GA1669764@fullerene.field.pennock-tech.net> <CAN=4vMrFhmKitKbdPdabZ1Ey9cjmEf62GVaGVMxn6T9AjZVc8Q@mail.gmail.com> <20200911161000.GA1679994@fullerene.field.pennock-tech.net> <CAN=4vMq-prFqopCW8apuYO8YUnuKL8G=WX+jBXFwgiFkfY=5Pw@mail.gmail.com> <CAH+w=7Y2VQpidVcinSXkQQqng0XjOwYtWL7a8jiYFx+te7fQCw@mail.gmail.com> <CAN=4vMrC2QjfxWaPUE9QS9tENBu=7BB=Hmp5rY6SaFahFThq=Q@mail.gmail.com> <CAH+w=7YDbOLz8Vp9v1tuweX9rGynS19GQ3FDiSryvqX=iz2sNA@mail.gmail.com> <CAN=4vMr0ucdLxfb+GMevBVT-=u1oNRr+Tc9EEVKizkeQC5tL7A@mail.gmail.com> <CAH+w=7aBwDz_Uo4r2ohv9wLBpeHna2C9g0QGN5FsXmqs8Hh2CA@mail.gmail.com> <CAN=4vMp4nkPQ9GrHNyDC4_qijrdfiuSmm-aE-AC_vOi1LjkvBA@mail.gmail.com>
- Sender: zsh-workers-request@xxxxxxx
On Sun, Sep 13, 2020 at 2:31 AM Roman Perepelitsa
<roman.perepelitsa@xxxxxxxxx> 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.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author