Tramp: hangs with "found remote shell prompt", got run nil "/bin:/usr/bin" repeatedly in debug buffer

532 Views Asked by At

I tried to use Tramp on MacOS with the Emacs downloaded from http://emacsformacosx.com/ and the versions are: Emacs: 26.3 Tramp: 2.3.5.26.3

When I connect to a ubuntu server, Tramp always hang after showing "found remote shell prompt". I set verbose to 10 with the following command:

(setq tramp-verbose 10)

Then type Ctrl-g after it hangs. The following messages repeat forever in the debug buffer:

21:07:47.790498 tramp-get-connection-property (7) # check-remote-echo nil
21:07:47.790591 tramp-get-connection-property (7) # check-remote-echo nil
21:07:48.794171 tramp-accept-process-output (10) # *tramp/ssh [email protected]* run nil
"/bin:/usr/bin"
tramp_exit_status 0

I tried different Linux hosts but got the same error. I have set up my ssh key so I can ssh without inputting a password. How do I debug further to make Tramp work?

1

There are 1 best solutions below

0
Wenguang Wang On

Thanks Michael Albinus's help through the [email protected] I have found out what's wrong.

First I should add [[ $TERM == "dumb" ]] && PS1='$ ' && return in the .profile of the remote shell to make the prompt recognizable.

Then I need to disable .emacs by using emacs -Q --eval '(setq tramp-verbose 10)' and found that tramp works for me fine. This means my .emacs is wrong.

After bisecting I found the problem is due to a too-old AucTeX package I loaded.