Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Possible bug: HASH_CMDS has no observable effect

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]
  # 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]
  # hash | grep rsync

Discovered during the discussion of


Messages sorted by: Reverse Date, Date, Thread, Author