zsh-workers
 help / color / mirror / code / Atom feed
From: Roman Perepelitsa <roman.perepelitsa@gmail.com>
To: Zsh hackers list <zsh-workers@zsh.org>
Subject: Possible bug: HASH_CMDS has no observable effect
Date: Fri, 11 Sep 2020 10:21:19 +0200	[thread overview]
Message-ID: <CAN=4vMqM-2Vu0n+QTbA9B_9z=3DKDdiOKbDRRaGGOG2rbY7-jA@mail.gmail.com> (raw)

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.


             reply	other threads:[~2020-09-11  8:21 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-11  8:21 Roman Perepelitsa [this message]
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

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='CAN=4vMqM-2Vu0n+QTbA9B_9z=3DKDdiOKbDRRaGGOG2rbY7-jA@mail.gmail.com' \
    --to=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).