]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix Tramp error with eshell integration
authorMichael Albinus <michael.albinus@gmx.de>
Sun, 18 Sep 2022 10:51:52 +0000 (12:51 +0200)
committerMichael Albinus <michael.albinus@gmx.de>
Sun, 18 Sep 2022 10:51:52 +0000 (12:51 +0200)
* lisp/net/tramp-integration.el (tramp-eshell-directory-change):
Respect local `default-directory'.  (Bug#57556)

lisp/net/tramp-integration.el

index b5df9804ab47d91f47f1940e38aa48a1c5725677..9aa4b2b1e8436642ebaf8205291b430ccd092f9c 100644 (file)
@@ -134,8 +134,10 @@ been set up by `rfn-eshadow-setup-minibuffer'."
   ;; Remove last element of `(exec-path)', which is `exec-directory'.
   ;; Use `path-separator' as it does eshell.
   (setq eshell-path-env
-       (mapconcat
-        #'identity (butlast (tramp-compat-exec-path)) path-separator)))
+        (if (file-remote-p default-directory)
+            (mapconcat
+            #'identity (butlast (tramp-compat-exec-path)) path-separator)
+          (getenv "PATH"))))
 
 (with-eval-after-load 'esh-util
   (add-hook 'eshell-mode-hook