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.

up vote 1 down vote accepted

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 <[email protected]>.

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] ~> ")

New contributor
Darius is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

Your Answer

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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