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 47371
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx>
- Subject: Re: Possible bug: HASH_CMDS has no observable effect
- Date: Fri, 11 Sep 2020 14:10:33 -0700
- Archived-at: <https://zsh.org/workers/47371>
- Archived-at: <http://www.zsh.org/sympa/arcsearch_id/zsh-workers/2020-09/CAH%2Bw%3D7Y2VQpidVcinSXkQQqng0XjOwYtWL7a8jiYFx%2Bte7fQCw%40mail.gmail.com>
- Authentication-results: zsh.org; iprev=pass (mail-oi1-f176.google.com) smtp.remote-ip=209.85.167.176; 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=tBvRjV6rK82eu46Dlb/zR9z4UfYBGkEJ6+WfHtrQcAY=; b=scsg2e/OmMtW3tYRj3NeajhKhInKnBpqnpPxpD6dhHGn8VzsoWde++MbwY/YCeLM+v P2f/XmrF8V7M7DFa0NQ1LJRlt8bcz1ml82WzLOUEWkZwDze0qVdjY6FEAt5fTaRterQO uxdsWaS3kkNijw9Tt8nfzd6kSkTp51JeJk29OQVZ1/ecBMGDYOYSSSwux1eeeeVAfogw bAuiKLjG44D4VXoQNkwLPCjfWJlvqsnsm1U5awLC57YlSJZnk7YHOL90NLFi12e7ayqt nVE4+i/GYgcRk3miNm6LpNueJwqTL6GLSu+PPS0YwA9sYwb2tdyVz9K/7AzvLQkFr41Y WSMg==
- In-reply-to: <CAN=4vMq-prFqopCW8apuYO8YUnuKL8G=WX+jBXFwgiFkfY=5Pw@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>
- Sender: zsh-workers-request@xxxxxxx
On Fri, Sep 11, 2020 at 9:33 AM Roman Perepelitsa
<roman.perepelitsa@xxxxxxxxx> wrote:
>
> Why isn't rsync hashed the first time it's executed?
This is usually because of HASH_DIRS:
Whenever a command name is hashed, hash the directory containing
it, as well as all directories that occur earlier in the path.
Once the cache has been pre-populated by hashing a directory,
HASH_CMDS stops attempting to search that directory for new additions.
A "rehash" is needed to discard the cached directory and reload any
new commands that are now contained therein.
If you unset HASH_DIRS you might get what you want.
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. Refer
to the description of "rehash" under "Standard Styles".
Messages sorted by:
Reverse Date,
Date,
Thread,
Author