I use a Windows computer to control servers through Tramp (with plink). Here's my setup:

(setq explicit-shell-file-name "/bin/bash")
(setq default-directory "/plink:user@server:~")

Now when I run M-x shell it runs perfectly. All commands (w, ls...) work on the server.

M-x eshell does get me a prompt on the distant server. However, here's what I get with w:

/plink:user@server:/home/user $ w
w: command not found

The ls command on the current directory works. However, I cannot change directory :

/plink:user@server:/home/user $ cd Videos
No such directory found via CDPATH environment variable

Except if I use this small hack found on Reddit :

/plink:user@server:/home/user $ cd $PWD/Videos/
/plink:user@server:/home/user:/home/user/Videos $ 

So, what elements of configuration am I missing to have a working eshell on my distant server?

  • I'm not quite sure, but I believe there were related bugs in Emacs, which are fixed. If you have a chance to test with a snapshot version of Emacs 27.1, this might be fixed. If not, pls send a bug report. Jul 8 '19 at 12:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.