2

Using Emacs-25.2.1 on Windows XP (and on 7, too) I can connect to my Raspberry Pi (Rasppian OS) using TRAMP and the plink method and it works flawlessly. But when I try to connect to my Mac mini (OSX 10.7.4), after I input the password it hangs on with the "Found remote shell prompt..." message. The shell on OSX is plain old bash with no fancy configuration in ~/.bash_profile and the sshd is the default one at /usr/sbin

If I try to connect directly from the CMD or MSYS shell to the OSX e.g.

$ plink [email protected]

It connects flawlessly. Any help is appreciated. Thanks.

Parts of debug tramp/ssh related to locale from the Linux connection:

12:40:09.589843 tramp-send-command (6) # locale -a

12:40:09.655846 tramp-wait-for-regexp (6) #

C

C.UTF-8

en_GB.utf8

en_US.utf8

POSIX

tr_TR

tr_TR.iso88599

tr_TR.utf8

turkish

12:40:09.709849 tramp-open-connection-setup-interactive-shell (5) # Setting coding system to ‘utf-8’ and ‘utf-8-unix’

Parts of debug tramp/ssh related to locale from the OSX connection:

12:33:56.549506 tramp-send-command (6) # locale -a

12:33:56.655512 tramp-wait-for-regexp (6) #

af_ZA

af_ZA.ISO8859-1

af_ZA.ISO8859-15

af_ZA.UTF-8

tr_TR

tr_TR.ISO8859-9

tr_TR.UTF-8

....

C

POSIX

12:33:56.709515 tramp-open-connection-setup-interactive-shell (5) # Setting coding system to utf-8-hfs and utf-8-hfs

3 Answers 3

1

Usually, this kind of problem is related to your remote shell prompt. Set tramp-verbose to 6 (or to 10, if it doesn't help), and rerun your test. If the Tramp traces don't tell you what's up, contact the Tramp tower via email, [email protected].

Edit: After investigation on the Tramp ML it has been shown, that this was a bug in Tramp. Will be fixed with the next Tramp 2.3.4 release.

7
  • Hello thank you for the reply. I've just added the trace-output buffer. Actually I had aleady looked into that but couldn't find any useful info in there, or does it actually contain useful info? So I've added the messages related to Tramp connection, too.
    – Terry
    Commented Feb 5, 2018 at 10:54
  • It's not really the Tramp traces I wanted to see. There must be a buffer *debug tramp/ssh [email protected]* which is relevant. Commented Feb 5, 2018 at 13:45
  • Thank you for the comment. I've copied that buffers output into this file: dropbox.com/s/cqr75lxf3e9rilf/TRAMP.txt?dl=0
    – Terry
    Commented Feb 5, 2018 at 18:44
  • I still believe we shall trace it on the Tramp mailing list, what we're doing here exceeds the offer of stackeexchange. In short: your remote Mac does not offer a utf8 locale, see the output of locale -a. Likely, this is the problem. Commented Feb 6, 2018 at 7:18
  • Thank you for the comment. In the attached .txt file, I had removed the lines of locale output because they were too long. Now I edited the original post to include those lines. Btw, both Windows machines are using the turkish language as default. If it cannot be solved after this stage, I might as well post it to the Tramp mailing list.
    – Terry
    Commented Feb 6, 2018 at 10:29
1

Since Apple deprecated bash in favour of zsh, a message appears on login about ‘default interactive shell is now zsh’. This seems to mess with Tramp.

To disable it, add export BASH_SILENCE_DEPRECATION_WARNING=1 to your .bash_profile

1
  • Good comment. However this issue was solved and afterwards never popped up again
    – Terry
    Commented Mar 20, 2020 at 15:36
0

I had the exact same problem (connecting to Mac OS from Windows using plink hanged on Found remote shell prompt). After turning logging verbosity of tramp to 10 I was able to see that tramp was waiting to receive the response of a remote shell command. The response was in the log, but it was terminated by two repetitions of tramp-end-of-output variable which contains an MD5 session identifier. The regular expression in tramp-wait-for-output function was expecting only one session identifier to indicate the end of response, so it kept waiting.

I fixed it by changing the regexp

format "[^#$\n]*%s\r?$" (regexp-quote tramp-end-of-output)

in tramp-sh.el file to

format "[^#$\n]*\\(%s\\)+\r?$" (regexp-quote tramp-end-of-output)

to allow for multiple occurrences of tramp-end-of-output string.

After making the change, I needed to recompile the file by executing

emacs -Q --batch -f batch-byte-compile "<path_to_file>/tramp-sh.el"

Afterward, I was able to connect without problems.

1
  • where is this file, i can't find it
    – c-o-d
    Commented Sep 12, 2020 at 0:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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