I am connected to another machine using tramp and my eshell does send all the commands to remote machine but when I do echo $PATH it prints me my local PATH. Why?

  • Because eshell is not a shell running on that remote machine?
    – phils
    Mar 7, 2019 at 18:53
  • If you need a shell running on the remote machine, then don't use eshell. Use shell, or run a shell inside term, or similar.
    – phils
    Mar 7, 2019 at 19:41
  • @phils, Absolutely. What then eshells ssh support actually offers? Mixture of host's and remote's shells? How do I distinguish what I am running when I use eshell? Why do we have ssh support in eshell? Now I use ansi-term.
    – yujaiyu
    Mar 7, 2019 at 22:05
  • Why? Because having that support is notably better than not having it. And of course there's nothing stopping you from running ssh <hostname> from eshell (but at that point I think one of the other options is more sensible). eshell is a native elisp shell; there's no "mixture of host's and remote's shell" happening.
    – phils
    Mar 8, 2019 at 0:35
  • 2
    @phils At first I also thought that this would be related to eshell not running on the remote host. But then I found the comment Content of $PATH. It might be different from \(getenv \"PATH\"), when 'default-directory' points to a remote host. of eshell-path-env. The variable eshell-path-env is actually set by tramp-eshell-directory-change if default-directory is a tramp-tramp-file-name-p.
    – Tobias
    Mar 8, 2019 at 5:31


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.