summaryrefslogtreecommitdiff
path: root/lisp/eshell/esh-util.el
diff options
context:
space:
mode:
authorBernhard Rotter <bernhard.rotter@gmail.com>2019-05-30 10:13:00 +0200
committerEli Zaretskii <eliz@gnu.org>2019-06-08 11:29:34 +0300
commit8a75bde4a6c7bfd87ad3265195cffb2a3a29c662 (patch)
tree764f6c34bb3f8d8f1c4297266568afd4c7d3932f /lisp/eshell/esh-util.el
parent1cc90d21d6e1aa21ab99d163796b41920b413ac7 (diff)
downloademacs-8a75bde4a6c7bfd87ad3265195cffb2a3a29c662.tar.gz
Fix path for current directory in eshell on MS-Windows
On MS-Windows, PATH implicitly includes the current directory. Do it right for Eshell by adding "./" instead of ".", to avoid finding .FOO instead of ./FOO. * lisp/eshell/esh-util.el (eshell-get-path): New function. * lisp/eshell/em-cmpl.el (eshell-complete-commands-list): * lisp/eshell/esh-ext.el (eshell-search-path): Use eshell-get-path.
Diffstat (limited to 'lisp/eshell/esh-util.el')
-rw-r--r--lisp/eshell/esh-util.el8
1 files changed, 8 insertions, 0 deletions
diff --git a/lisp/eshell/esh-util.el b/lisp/eshell/esh-util.el
index 6f355c70a42..633bd02d2d2 100644
--- a/lisp/eshell/esh-util.el
+++ b/lisp/eshell/esh-util.el
@@ -232,6 +232,14 @@ It might be different from \(getenv \"PATH\"), when
`default-directory' points to a remote host.")
(make-variable-buffer-local 'eshell-path-env)
+(defun eshell-get-path ()
+ "Return $PATH as list.
+Add the current directory on windows."
+ (eshell-parse-colon-path
+ (if (eshell-under-windows-p)
+ (concat "." path-separator eshell-path-env)
+ eshell-path-env)))
+
(defun eshell-parse-colon-path (path-env)
"Split string with `parse-colon-path'.
Prepend remote identification of `default-directory', if any."