Function: tramp-eshell-directory-change

tramp-eshell-directory-change is a byte-compiled function defined in tramp-integration.el.gz.

Signature

(tramp-eshell-directory-change)

Documentation

Set eshell-path-env to $PATH of the host related to default-directory.

Source Code

;; Defined in /usr/src/emacs/lisp/net/tramp-integration.el.gz
;;; Integration of eshell.el:

;; eshell.el keeps the path in `eshell-path-env'.  We must change it
;; when `default-directory' points to another host.
;; This is fixed in Eshell with Emacs 29.1.

(defun tramp-eshell-directory-change ()
  "Set `eshell-path-env' to $PATH of the host related to `default-directory'."
  ;; Remove last element of `(exec-path)', which is `exec-directory'.
  ;; Use `path-separator' as it does eshell.
  (setq eshell-path-env
        (if (tramp-tramp-file-p default-directory)
            (string-join (butlast (exec-path)) path-separator)
          (getenv "PATH"))))