I have always found TRAMP to be crazy slow (5+ secs to fetch a directory listing) so I've avoided it for years. Time to figure out what is going on. I'm always connecting via ssh, using declarations in ~/.ssh/config. The connections are fine, I've survived buy running remote emacs sessions in a terminal.

I figured out how to turn on tramp debugging but not sure how to read the output. It appears that there might be a delay before tramp starts doing anything? Perhaps tramp is conflicting with some other mode?

  • I don't see this. Does it happen in emacs -Q? Does it happen when you try to connect with ssh manually? – PythonNut Sep 10 '15 at 2:04
  • I use Emacs built for OSX in GUI mode, and I don't see any unreasonably long wait when connecting to my remote server on a shared box in cyberspace -- liquidweb. I use dired-mode when navigating the shared server. However, I don't use a ~/.ssh/config. I just have the known_hosts file that gets set up the first time I connected via ssh. Do you have the most recent stable public release of Emacs built for OSX? – lawlist Sep 10 '15 at 3:32
  • 1
    Use (setq tramp-verbose 6). The debug output includes timestamps, this might tell us what happens. Since sx might not be the best medium for discussing traces, you might send them to the Tramp mailing list, or directly to me. – Michael Albinus Sep 10 '15 at 7:27
  • The first thing I do is set process-connection-type to nil and watch for any relevant bugs here. – Emacs User Sep 11 '15 at 1:16

I know it's an old question and that you maybe don't care about the answer now but I do faced the same issue.

I was pretty sure it was OS X related but in fact lags and timeouts were caused by my remote prompt!

Tramp is limited in its remote prompt parsing and relies on it to know if a command has finished or not.

I googled for days always including "os x" in my searches but in fact it's not related at all. As you can see in the official FAQ the remote prompt has to be very simple for Tramp to work. You can tweak the regexp in your Emacs config to avoid changing the prompt on the remote but honestly if you can do it on the remote it's easier.

Just add [ $TERM = "dumb" ] && unsetopt zle && PS1='$ ' to your remote .zshrc or something similar if you use another shell. The point is the prompt as to be $.

Hope it'll help someone.

  • Any advice, for the case in which one cannot or prefers not to change the remote prompt, on how to specify the prompt, e.g. for prompts with coloring, which apparently causes parsing problem? – Jesse W. Collins Nov 25 '19 at 20:40
  • 1
    Hi Jess. As I said in my answer, the other solution is to tweak the regexp in your Emacs config to avoid changing the prompt on the remote. This regex is stored in tramp-shell-prompt-pattern variable. Tramps relies on this one to parse the remote prompt. Shell prompts that contain escape sequences for coloring are known to cause parsing problems. – Bounga Nov 29 '19 at 14:51

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.