With recent versions of Emacs, tramp routinely hangs at the time of making the connection.

The *Messages* buffer gives no information.

Is there a way to get more information as to what's happening?

I have seen this hanging behavior in two forms.

On sudo-based connections, tramp hangs right after I enter the password for sudo, and hit return.

On ssh-based connections, tramp will hang right after the appearance of the message

Waiting from prompts from remote shell... 

In either case, it would be helpful to know what tramp is doing all this time.


Read the Tramp manual about traces (info "(tramp) Traces and Profiles")

In short, set tramp-verbose to 6, rerun your test, and check the Tramp debug buffer. In some rare cases it might be necessary to use a higher verbosity, up to 10.

If you have problems understanding the traces, contact the Tramp team by writing a bug report to <tramp-devel@gnu.org>.


I had it hang because it couldn't detect the shell prompt, I added this to my .zshenv file..

# Fix for TRAMP
[ $TERM = "dumb" ] && unsetopt zle && PS1='$ '

Alternatively you can change what is considered a shell prompt by emacs..

; The default does not like the ~ before > so do a kludge
(setq shell-prompt-pattern '"^[^#$%>\n]*~?[#$%>] *")

(Mine is "[hostname] ~> ")

  • 1
    That fixed mine too. The default zsh shell prompt seems to break Tramp. – MikeHoss May 9 '19 at 19:26

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.