zsh-workers
 help / color / mirror / code / Atom feed
* Possible bug: HASH_CMDS has no observable effect
@ 2020-09-11  8:21 Roman Perepelitsa
  2020-09-11 14:48 ` Phil Pennock
  0 siblings, 1 reply; 13+ messages in thread
From: Roman Perepelitsa @ 2020-09-11  8:21 UTC (permalink / raw)
  To: Zsh hackers list

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.


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2020-09-13 22:24 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-11  8:21 Possible bug: HASH_CMDS has no observable effect 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

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).