1

I'm using both the latest Cygwin and the latest (released) Emacs. I'm trying to remote in from a Linux box to a Windows box running a Cygwin configured sshd.

I've added this line to the top of my .bashrc in Cygwin:

PS1='$ ' && return

Doing ssh <own ip> reveals that the prompt is indeed set to a single dollar sign. Unfortunately, TRAMP still hangs on.

Tramp: found remote shell prompt

I would very much like to get this working. I don't really know what information is needed to fix this, but the machine is available and I'll do whatever anyone asks me.

EDIT: Here are the last few lines from the TRAMP debug buffer:

00:20:46.867625 tramp-process-one-action (5) # Looking for regexp "\(^.*\(\(?:adgangskode\|contrase\(?:\(?:ny\|ñ\)a\)\|geslo\|h\(?:\(?:asł\|esl\)o\)\|iphasiwedi\|jelszó\|l\(?:ozinka\|ösenord\)\|m\(?:ot de passe\|ật khẩu\)\|pa\(?:rola\|s\(?:ahitza\|s\(?: phrase\|ord\|phrase\|wor[dt]\)\|vorto\)\)\|s\(?:alasana\|enha\|laptažodis\)\|wachtwoord\|лозинка\|пароль\|ססמה\|كلمة السر\|गुप्तशब्द\|शब्दकूट\|গুপ্তশব্দ\|পাসওয়ার্ড\|ਪਾਸਵਰਡ\|પાસવર્ડ\|ପ୍ରବେଶ ସଙ୍କେତ\|கடவுச்சொல்\|సంకేతపదము\|ಗುಪ್ತಪದ\|അടയാളവാക്ക്\|රහස්පදය\|ពាក្យសម្ងាត់\|パスワード\|密[码碼]\|암호\)\).*:? *\)\'" from remote shell
00:20:46.867729 tramp-get-connection-property (7) # check-remote-echo nil
00:20:46.867806 tramp-get-connection-property (7) # check-remote-echo nil
00:20:46.867940 tramp-process-one-action (5) # Looking for regexp "\(^.*\(Connection \(?:\(?:clo\|refu\)sed\)\|Host key verification failed\.\|Login \(?:[Ii]ncorrect\)\|N\(?:ame or service not known\|o supported authentication methods left to try!\)\|Permission denied\|\(?:Sorry, try again\|Timeout, server not responding\)\.\).*\|^.*\(Received signal [0-9]+\).*\)\'" from remote shell
00:20:46.868026 tramp-get-connection-property (7) # check-remote-echo nil
00:20:46.868102 tramp-get-connection-property (7) # check-remote-echo nil
00:20:46.868206 tramp-process-one-action (5) # Looking for regexp "\(^[^#$%>
]*[#$%>] *\)\'" from remote shell
00:20:46.868287 tramp-get-connection-property (7) # check-remote-echo nil
00:20:46.868360 tramp-get-connection-property (7) # check-remote-echo nil
00:20:46.868450 tramp-process-one-action (5) # Call `tramp-action-succeed'
00:20:46.868577 tramp-get-connection-property (7) # process-buffer nil
00:20:46.868671 tramp-process-actions (6) # 
root@192.168.0.132's password: 
Last login: Wed Dec 17 16:20:31 2014 from hexagon
$ 
00:20:46.868759 tramp-get-connection-property (7) # process-buffer nil
00:20:46.869100 tramp-process-actions (3) # Waiting for prompts from remote shell...done
00:20:46.869438 tramp-maybe-open-connection (3) # Found remote shell prompt on `192.168.0.132'
00:20:46.869610 tramp-get-connection-property (7) # remote-shell nil
00:20:46.869742 tramp-open-shell (5) # Opening remote shell `/bin/sh'...
00:20:46.869956 tramp-get-connection-property (7) # process-name nil
00:20:46.870141 tramp-get-connection-property (7) # remote-echo nil
00:20:46.870232 tramp-send-command (6) # exec env ENV='' HISTFILE=/dev/null PROMPT_COMMAND='' PS1=\#\$\  PS2='' PS3='' /bin/sh 
00:20:46.870324 tramp-get-connection-property (7) # process-name nil
00:20:46.870429 tramp-get-connection-property (7) # chunksize nil
00:20:46.870531 tramp-set-connection-property (7) # last-cmd-time (21650 7646 870498 395000)
00:20:46.870630 tramp-send-string (10) # exec env ENV='' HISTFILE=/dev/null PROMPT_COMMAND='' PS1=\#\$\  PS2='' PS3='' /bin/sh 
00:20:46.870719 tramp-get-connection-property (7) # process-buffer nil
00:20:46.870906 tramp-get-connection-property (7) # check-remote-echo nil
00:20:46.870989 tramp-get-connection-property (7) # check-remote-echo nil
00:20:46.871076 tramp-accept-process-output (10) # *tramp/ssh root@192.168.0.132* run
00:20:47.871626 tramp-accept-process-output (10) # 
00:20:47.871832 tramp-get-connection-property (7) # check-remote-echo nil
00:20:47.871994 tramp-get-connection-property (7) # check-remote-echo nil
00:20:47.872251 tramp-accept-process-output (10) # *tramp/ssh root@192.168.0.132* run
00:20:48.873309 tramp-accept-process-output (10) # 
00:20:48.873736 tramp-get-connection-property (7) # check-remote-echo nil
00:20:48.874024 tramp-get-connection-property (7) # check-remote-echo nil
00:20:48.874308 tramp-accept-process-output (10) # *tramp/ssh root@192.168.0.132* run
00:20:49.876580 tramp-accept-process-output (10) # 
00:20:49.877040 tramp-get-connection-property (7) # check-remote-echo nil
00:20:49.877350 tramp-get-connection-property (7) # check-remote-echo nil
00:20:49.877639 tramp-accept-process-output (10) # *tramp/ssh root@192.168.0.132* run
00:20:50.878858 tramp-accept-process-output (10) # 
00:20:50.880145 tramp-get-connection-property (7) # check-remote-echo nil
00:20:50.880448 tramp-get-connection-property (7) # check-remote-echo nil
00:20:50.880786 tramp-accept-process-output (10) # *tramp/ssh root@192.168.0.132* run
00:20:51.881874 tramp-accept-process-output (10) # 
00:20:51.883160 tramp-get-connection-property (7) # check-remote-echo nil
00:20:51.883507 tramp-get-connection-property (7) # check-remote-echo nil
00:20:51.883858 tramp-accept-process-output (10) # *tramp/ssh root@192.168.0.132* run
00:20:52.885235 tramp-accept-process-output (10) # 
00:20:52.885571 tramp-get-connection-property (7) # check-remote-echo nil
00:20:52.886065 tramp-get-connection-property (7) # check-remote-echo nil
00:20:52.886413 tramp-accept-process-output (10) # *tramp/ssh root@192.168.0.132* run
00:20:53.887413 tramp-accept-process-output (10) # 
00:20:53.887854 tramp-get-connection-property (7) # check-remote-echo nil
00:20:53.888154 tramp-get-connection-property (7) # check-remote-echo nil
00:20:53.888438 tramp-accept-process-output (10) # *tramp/ssh root@192.168.0.132* run
00:20:54.890273 tramp-accept-process-output (10) # 
00:20:54.890382 tramp-get-connection-property (7) # check-remote-echo nil
00:20:54.890455 tramp-get-connection-property (7) # check-remote-echo nil
00:20:54.890525 tramp-accept-process-output (10) # *tramp/ssh root@192.168.0.132* run
00:20:55.891045 tramp-accept-process-output (10) # 
00:20:55.891197 tramp-get-connection-property (7) # check-remote-echo nil
00:20:55.891312 tramp-get-connection-property (7) # check-remote-echo nil
00:20:55.891428 tramp-accept-process-output (10) # *tramp/ssh root@192.168.0.132* run
00:20:56.893634 tramp-accept-process-output (10) # 
00:20:56.894073 tramp-get-connection-property (7) # check-remote-echo nil
00:20:56.894368 tramp-get-connection-property (7) # check-remote-echo nil
00:20:56.894654 tramp-accept-process-output (10) # *tramp/ssh root@192.168.0.132* run
00:20:57.896874 tramp-accept-process-output (10) # 
00:20:57.897336 tramp-get-connection-property (7) # check-remote-echo nil
00:20:57.897650 tramp-get-connection-property (7) # check-remote-echo nil
00:20:57.897707 tramp-accept-process-output (10) # *tramp/ssh root@192.168.0.132* run
00:20:58.898896 tramp-accept-process-output (10) # 
00:20:58.899075 tramp-get-connection-property (7) # check-remote-echo nil
00:20:58.899160 tramp-get-connection-property (7) # check-remote-echo nil
00:20:58.899241 tramp-accept-process-output (10) # *tramp/ssh root@192.168.0.132* run
00:20:59.899977 tramp-accept-process-output (10) # 
00:20:59.900087 tramp-get-connection-property (7) # check-remote-echo nil
00:20:59.900167 tramp-get-connection-property (7) # check-remote-echo nil
00:20:59.900242 tramp-accept-process-output (10) # *tramp/ssh root@192.168.0.132* run
00:21:00.901654 tramp-accept-process-output (10) # 
00:21:00.914983 tramp-get-connection-property (7) # check-remote-echo nil
00:21:00.915349 tramp-get-connection-property (7) # check-remote-echo nil
00:21:00.915642 tramp-accept-process-output (10) # *tramp/ssh root@192.168.0.132* run
00:21:01.918396 tramp-accept-process-output (10) # 
00:21:01.918738 tramp-get-connection-property (7) # check-remote-echo nil
00:21:01.919128 tramp-get-connection-property (7) # check-remote-echo nil
00:21:01.919459 tramp-accept-process-output (10) # *tramp/ssh root@192.168.0.132* run
00:21:02.922186 tramp-accept-process-output (10) # 
00:21:02.922917 tramp-get-connection-property (7) # check-remote-echo nil
00:21:02.923275 tramp-get-connection-property (7) # check-remote-echo nil
00:21:02.923577 tramp-accept-process-output (10) # *tramp/ssh root@192.168.0.132* run
00:21:03.925233 tramp-accept-process-output (10) # 
00:21:03.925568 tramp-get-connection-property (7) # check-remote-echo nil
00:21:03.926084 tramp-get-connection-property (7) # check-remote-echo nil
00:21:03.926437 tramp-accept-process-output (10) # *tramp/ssh root@192.168.0.132* run
00:21:04.932720 tramp-accept-process-output (10) # 
00:21:04.933105 tramp-get-connection-property (7) # check-remote-echo nil
00:21:04.933397 tramp-get-connection-property (7) # check-remote-echo nil
00:21:04.933749 tramp-accept-process-output (10) # *tramp/ssh root@192.168.0.132* run
00:21:05.934743 tramp-accept-process-output (10) # 
00:21:05.935194 tramp-get-connection-property (7) # check-remote-echo nil
00:21:05.935509 tramp-get-connection-property (7) # check-remote-echo nil
00:21:05.935848 tramp-accept-process-output (10) # *tramp/ssh root@192.168.0.132* run
00:21:06.937524 tramp-accept-process-output (10) # 
00:21:06.937963 tramp-get-connection-property (7) # check-remote-echo nil
00:21:06.938262 tramp-get-connection-property (7) # check-remote-echo nil
00:21:06.938546 tramp-accept-process-output (10) # *tramp/ssh root@192.168.0.132* run
00:21:07.943139 tramp-accept-process-output (10) # 
00:21:07.943530 tramp-get-connection-property (7) # check-remote-echo nil
00:21:07.943793 tramp-get-connection-property (7) # check-remote-echo nil
00:21:07.944043 tramp-accept-process-output (10) # *tramp/ssh root@192.168.0.132* run
00:21:08.944492 tramp-accept-process-output (10) # 
00:21:08.944615 tramp-get-connection-property (7) # check-remote-echo nil
00:21:08.944697 tramp-get-connection-property (7) # check-remote-echo nil
00:21:08.944777 tramp-accept-process-output (10) # *tramp/ssh root@192.168.0.132* run
00:21:09.946517 tramp-accept-process-output (10) # 
00:21:09.947009 tramp-get-connection-property (7) # check-remote-echo nil
00:21:09.947325 tramp-get-connection-property (7) # check-remote-echo nil
00:21:09.947617 tramp-accept-process-output (10) # *tramp/ssh root@192.168.0.132* run
00:21:10.948612 tramp-accept-process-output (10) # 
00:21:10.948899 tramp-get-connection-property (7) # check-remote-echo nil
00:21:10.949396 tramp-get-connection-property (7) # check-remote-echo nil
00:21:10.949712 tramp-accept-process-output (10) # *tramp/ssh root@192.168.0.132* run
00:21:12.064294 tramp-accept-process-output (10) # 
00:21:12.064438 tramp-get-connection-property (7) # check-remote-echo nil
00:21:12.064543 tramp-get-connection-property (7) # check-remote-echo nil
00:21:12.064642 tramp-accept-process-output (10) # *tramp/ssh root@192.168.0.132* run
00:21:13.065006 tramp-accept-process-output (10) # 
00:21:13.065150 tramp-get-connection-property (7) # check-remote-echo nil
00:21:13.065257 tramp-get-connection-property (7) # check-remote-echo nil
00:21:13.065358 tramp-accept-process-output (10) # *tramp/ssh root@192.168.0.132* run
00:21:14.066901 tramp-accept-process-output (10) # 
00:21:14.067126 tramp-get-connection-property (7) # check-remote-echo nil
00:21:14.067359 tramp-get-connection-property (7) # check-remote-echo nil
00:21:14.067523 tramp-accept-process-output (10) # *tramp/ssh root@192.168.0.132* run
00:21:15.068126 tramp-accept-process-output (10) # 
00:21:15.068312 tramp-get-connection-property (7) # check-remote-echo nil
00:21:15.068465 tramp-get-connection-property (7) # check-remote-echo nil
00:21:15.068654 tramp-accept-process-output (10) # *tramp/ssh root@192.168.0.132* run
00:21:16.070011 tramp-accept-process-output (10) # 
00:21:16.070121 tramp-get-connection-property (7) # check-remote-echo nil
00:21:16.070198 tramp-get-connection-property (7) # check-remote-echo nil
00:21:16.070273 tramp-accept-process-output (10) # *tramp/ssh root@192.168.0.132* run
00:21:17.072215 tramp-accept-process-output (10) # 
00:21:17.072229 tramp-get-connection-property (7) # check-remote-echo nil
00:21:17.072461 tramp-get-connection-property (7) # check-remote-echo nil
00:21:17.072629 tramp-accept-process-output (10) # *tramp/ssh root@192.168.0.132* run
00:21:18.075270 tramp-accept-process-output (10) # 
00:21:18.075411 tramp-get-connection-property (7) # check-remote-echo nil
00:21:18.075514 tramp-get-connection-property (7) # check-remote-echo nil
00:21:18.075625 tramp-accept-process-output (10) # *tramp/ssh root@192.168.0.132* run
00:21:19.078041 tramp-accept-process-output (10) # 
00:21:19.078186 tramp-get-connection-property (7) # check-remote-echo nil
00:21:19.078293 tramp-get-connection-property (7) # check-remote-echo nil
00:21:19.078395 tramp-accept-process-output (10) # *tramp/ssh root@192.168.0.132* run
00:21:19.388384 tramp-open-shell (5) # Opening remote shell `/bin/sh'...failed
00:21:19.389169 tramp-maybe-open-connection (3) # Opening connection for root@192.168.0.132 using ssh...failed
00:21:19.389481 tramp-get-file-property (8) #  file-truename nil
00:21:19.389695 tramp-flush-directory-property (8) # 
00:21:19.389949 tramp-get-connection-property (7) # process-name nil
00:21:19.390179 tramp-get-connection-property (7) # process-name nil
00:21:19.390617 tramp-get-connection-property (7) # vector [ssh root 192.168.0.132 ~ nil]
00:21:19.390846 tramp-process-sentinel (5) # Sentinel called: `#<process *tramp/ssh root@192.168.0.132*>' `killed
'
00:21:19.391118 tramp-flush-connection-property (7) # *tramp/ssh root@192.168.0.132* (vector temp-file last-cmd-time)
00:21:19.391364 tramp-get-file-property (8) #  file-truename nil
00:21:19.391723 tramp-flush-directory-property (8) # 
00:21:19.513996 tramp-get-connection-property (7) # process-name nil
00:21:19.514284 tramp-flush-connection-property (7) # [ssh root 192.168.0.132 nil nil] (first-password-request)
00:21:19.514578 tramp-get-connection-property (7) # process-buffer nil
00:21:19.514815 tramp-get-file-property (8) # / file-truename nil
00:21:19.514933 tramp-flush-file-property (8) # /
00:21:19.515035 tramp-file-name-handler (1) # Interrupt received in operation (expand-file-name /ssh:root@192.168.0.132:~ nil)

The "interrupt" is me pressing C-g after a long time waiting.

  • Is the remote box using zsh? – nanny Dec 17 '14 at 21:43
  • Nope, it's a pretty stock Cygwin install, which uses bash. – PythonNut Dec 17 '14 at 21:51
  • I don't know where I got this PS1 from, but this is what I have on my Arch VPS that helped TRAMP work: if [[ $TERM == "dumb" ]]; then PS1='%(?..[%?])%!:%~%# ' fi – nanny Dec 17 '14 at 21:58
  • @nanny sadly, that doesn't seem to help. I don't think the prompt is the issue. – PythonNut Dec 18 '14 at 0:40
  • @phils I'm actually talking about emacs running on linux, talking to a sshd running inside Cygwin on Windows, not the other way 'round. – PythonNut Dec 20 '14 at 22:26
2

The usual recipe is to apply (setq tramp-verbose 10) and to rerun the test. There will be a (longish) Tramp debug buffer, which shall tell what's up.

  • Added buffer contents to question. – PythonNut Dec 18 '14 at 0:33
  • According to the log, the login on the remote host succeeded. After that, Tramp has sent the command exec env ENV='' HISTFILE=/dev/null PROMPT_COMMAND='' PS1=\#\$\ PS2='' PS3='' /bin/sh. There's no output from that. What happens, if you connect to the remote host in a shell (outside Emacs), and apply that command? – Michael Albinus Dec 18 '14 at 9:20
  • Well, I get a /bin/sh (symlink to bash) with the prompt set to #$ PS2=, which I sense is not what they were going for. Is there an extra backslash? – PythonNut Dec 18 '14 at 20:11
  • Every char counts! There are two spaces between $\ and PS2=. – Michael Albinus Dec 19 '14 at 8:45
  • Strange... there might be a bug in Cygwin clipboard handling. Anyway, the command does exactly what you'd expect it resets the prompts, the ENV and HISTFILE for bash. – PythonNut Dec 19 '14 at 17:00
1

This doesn't exactly answer your question, but have you tried using tramp with the smb method? I have been using this for years to edit files located on a Windows machine from my Emacs session on Linux, and I am very happy with it. The only drawback might be, that you have to define a share to be able to access the files on Windows.

  • This is more of a comment than an answer. I would suggest either asking this as a comment on the question or expanding it to provide a working example of using it this way. – Jonathan Leech-Pepin Dec 18 '14 at 12:31
  • As an example on how I use this, you can simply open a file by handing the following file to tramp: smb:winUser%winDomain@host:/E$/ works, if E: is accessible as a share. I use bookmarks in conjunction with remote editing, which makes it easier to handle. – Martin Dec 19 '14 at 13:02

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.