Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Possible bug: HASH_CMDS has no observable effect
- X-seq: zsh-workers 47366
- From: Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Possible bug: HASH_CMDS has no observable effect
- Date: Fri, 11 Sep 2020 10:21:19 +0200
- Archived-at: <https://zsh.org/workers/47366>
- Archived-at: <http://www.zsh.org/sympa/arcsearch_id/zsh-workers/2020-09/CAN%3D4vMqM-2Vu0n%2BQTbA9B_9z%3D3DKDdiOKbDRRaGGOG2rbY7-jA%40mail.gmail.com>
- Authentication-results: zsh.org; iprev=pass (mail-io1-f48.google.com) smtp.remote-ip=209.85.166.48; dkim=pass header.d=gmail.com header.s=20161025 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=ZxmX86TODZhkNA7J7MAeqkEsaz8LCiBtaHSoQDGQZ/g=; b=qDIXk16MMpd+nUCvTdpHTdMmYw4HZ0BTwhg0/tidYe7SyCSMwdpOQH5j+FWOBVFY/U 0Ji4cwkodx8q1mPJG8pTcw17derY/2WUtK4QYhQU9rKwDZykVvv/o0IUNiDFWcRkIRdC bq1NL0ARRb5SlstHqwatmjIUZoAkI7utTNfC8TNqb4EPob9uh4L4V5nWIW/zZHcHAjo2 wP52nSRtA0ymH+F5RsGv6xpvKhaPqf7FAFsu1CHKGPT/lYyarZyGOZLZd4ccE+co1qoJ FBFCYJqsR0LFKuTqYG1BgFruFuimJbZd3dqFqTgWU9zP+xY5l6hi8iQdJCfzHxYZFT48 fAmw==
- 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>
- Sender: zsh-workers-request@xxxxxxx
From the documentation for HASH_CMDS option:
Note the location of each command the first time it is executed.
Subsequent invocations of the same command will use the saved
location, avoiding a path search. If this option is unset, no path
hashing is done at all. However, when CORRECT is set, commands
whose names do not appear in the functions or aliases hash tables
are hashed in order to avoid reporting them as spelling errors.
I took this to mean that after installing rsync and invoking it,
${commands[rsync]} will be set and running `hash` will display an
entry for rsync. This, however, is not the case.
% sudo docker run -e TERM -it --rm zshusers/zsh:5.8
# print $options[hash_cmds]
on
# rsync
zsh: command not found: rsync
# apt-get update && apt-get install -y rsync
# rsync
rsync version 3.1.2 protocol version 31
# print $+commands[rsync]
0
# hash | grep rsync
#
Discovered during the discussion of
https://github.com/zsh-users/zsh-syntax-highlighting/pull/764.
Roman.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author