Print the correct $PATH when Eshell's 'which' fails to find a command

* lisp/eshell/esh-cmd.el (eshell/which): Use 'eshell-get-path'
(bug#20008).
This commit is contained in:
Jim Porter 2022-09-15 12:32:02 -07:00
parent cee1cbfd54
commit fd4992d356

View file

@ -1274,8 +1274,9 @@ be finished later after the completion of an asynchronous subprocess."
name)
(eshell-search-path name)))))
(if (not program)
(eshell-error (format "which: no %s in (%s)\n"
name (getenv "PATH")))
(eshell-error (format "which: no %s in (%s)\n"
name (string-join (eshell-get-path t)
(path-separator))))
(eshell-printn program)))))
(put 'eshell/which 'eshell-no-numeric-conversions t)