In my local shell, completion-at-point
after cd
returns a list of directories. However, when I ssh into a remote, Emacs thinks I'm still in my local home directory. How can I configure Emacs to give me remote directory autocompletion?
Asked
Active
Viewed 1,177 times
7

Matthew Piziak
- 5,958
- 3
- 29
- 77
-
Just to clarify, you're doing `M-x shell` from a local directory and then doing `ssh` command in that buffer? – Melioratus Nov 08 '15 at 20:39
-
That is correct. – Matthew Piziak Nov 08 '15 at 20:41
-
1Have you tried using opening the remote directory using `C-x d` `/ssh:username@hostname:/directory-path` and then using `M-x shell` to open a remote shell? – Melioratus Nov 08 '15 at 20:54
-
Interesting! Now autocompletion works, but typing is intolerably slow. – Matthew Piziak Nov 08 '15 at 20:57
-
Does it typing speed improve after a few minutes? Do you see any warnings in the *Messages* buffer? – Melioratus Nov 08 '15 at 21:07
-
Ten minutes later and typing speed hasn't improved. No warnings in the *Messages* buffer. Full output is here: http://pastebin.com/06wsB57n – Matthew Piziak Nov 09 '15 at 03:00
-
Would you post your full emacs version string as a comment? After googling [emacs tramp shell slow](https://www.google.com/search?q=emacs+tramp+shell+slow) I think you may have hit a bug. – Melioratus Nov 10 '15 at 14:44
-
GNU Emacs 25.0.50.1 (x86_64-apple-darwin14.0.0, NS appkit-1343.16 Version 10.10.1 (Build 14B25)) of 2015-03-02 on Matthews-MacBook-Air.local – Matthew Piziak Nov 10 '15 at 15:10
-
1I tried disabling `global-projectile-mode` and the situation improved significantly! – Matthew Piziak Nov 10 '15 at 15:12
-
Likewise after setqing projectile-mode-line to something that doesn't depend on `projectile-project-name`, so it looks like that is indeed the culprit. – Matthew Piziak Nov 10 '15 at 15:15
-
Setqing `projectile-file-exists-remote-cache-expire` to `nil` also helps, though not as much. – Matthew Piziak Nov 10 '15 at 15:18
-
Does the remote shell work okay now? – Melioratus Nov 12 '15 at 00:06
-
Well enough! Thank you for your help. If you would like to post this information as an answer, I'll be happy to accept it. – Matthew Piziak Nov 12 '15 at 00:08
1 Answers
4
Try this
Open a remote directory in
dired
usingtramp
.C-x d
/ssh:username@hostname:/path
returnStart a remote shell.
M-x
shell

Melioratus
- 4,504
- 1
- 25
- 43
-
Is there a way to make something like this work with Emacs `term` or preferably `multi-term` – rambalachandran Feb 15 '16 at 13:02