comparison lisp/net/tramp.el @ 87322:e99e230d7eb3

* files.el (cd-absolute): Set `list-buffers-directory' in order to show correct path in buffer list. * net/tramp.el (tramp-open-connection-setup-interactive-shell) (tramp-find-shell): Send only single prompt setting commands, in order to avoid double-prompt. * net/tramp-compat.el (top): Require cl only when compiling. Reported by Glenn Morris <rgm@gnu.org>.
author Michael Albinus <michael.albinus@gmx.de>
date Tue, 18 Dec 2007 21:02:53 +0000
parents dcdf399ba8a4
children 8b57223acf6b
comparison
equal deleted inserted replaced
87321:0c95db530576 87322:e99e230d7eb3
76 (add-hook 'tramp-unload-hook 76 (add-hook 'tramp-unload-hook
77 '(lambda () 77 '(lambda ()
78 (when (featurep 'tramp-compat) 78 (when (featurep 'tramp-compat)
79 (unload-feature 'tramp-compat 'force)))) 79 (unload-feature 'tramp-compat 'force))))
80 80
81 (require 'format-spec) ;from Gnus 5.8, also in tar ball 81 (require 'format-spec) ; from Gnus 5.8, also in tar ball
82 ;; As long as password.el is not part of (X)Emacs, it shouldn't 82 ;; As long as password.el is not part of (X)Emacs, it shouldn't
83 ;; be mandatory 83 ;; be mandatory
84 (if (featurep 'xemacs) 84 (if (featurep 'xemacs)
85 (load "password" 'noerror) 85 (load "password" 'noerror)
86 (or (require 'password-cache nil 'noerror) 86 (or (require 'password-cache nil 'noerror)
5363 ;; must use "\n" here, not tramp-rsh-end-of-line. Kai left the 5363 ;; must use "\n" here, not tramp-rsh-end-of-line. Kai left the
5364 ;; last tramp-rsh-end-of-line, Douglas wanted to replace that, 5364 ;; last tramp-rsh-end-of-line, Douglas wanted to replace that,
5365 ;; as well. 5365 ;; as well.
5366 (tramp-send-command 5366 (tramp-send-command
5367 vec 5367 vec
5368 (format "PROMPT_COMMAND=''; PS1='%s%s%s'; PS2=''; PS3=''" 5368 (format "PS1='%s%s%s'"
5369 tramp-rsh-end-of-line 5369 tramp-rsh-end-of-line
5370 tramp-end-of-output 5370 tramp-end-of-output
5371 tramp-rsh-end-of-line) 5371 tramp-rsh-end-of-line)
5372 t) 5372 t)
5373 (tramp-send-command vec "PS2=''" t)
5374 (tramp-send-command vec "PS3=''" t)
5375 (tramp-send-command vec "PROMPT_COMMAND=''" t)
5373 (tramp-message vec 5 "Setting remote shell prompt...done")) 5376 (tramp-message vec 5 "Setting remote shell prompt...done"))
5374 (t (tramp-message 5377 (t (tramp-message
5375 vec 5 "Remote `%s' groks tilde expansion, good" 5378 vec 5 "Remote `%s' groks tilde expansion, good"
5376 (tramp-get-method-parameter 5379 (tramp-get-method-parameter
5377 (tramp-file-name-method vec) 'tramp-remote-sh)) 5380 (tramp-file-name-method vec) 'tramp-remote-sh))
5636 ;; is another way to set the prompt in /bin/bash, it must be 5639 ;; is another way to set the prompt in /bin/bash, it must be
5637 ;; discarded as well. 5640 ;; discarded as well.
5638 (tramp-send-command 5641 (tramp-send-command
5639 vec 5642 vec
5640 (format 5643 (format
5641 "exec env 'ENV=' 'PROMPT_COMMAND=' 'PS1=$ ' PS2='' PS3='' %s" 5644 "exec env ENV='' PROMPT_COMMAND='' PS1='$ ' PS2='' PS3='' %s"
5642 (tramp-get-method-parameter 5645 (tramp-get-method-parameter
5643 (tramp-file-name-method vec) 'tramp-remote-sh)) 5646 (tramp-file-name-method vec) 'tramp-remote-sh))
5644 t) 5647 t)
5645 5648
5646 ;; Disable echo. 5649 ;; Disable echo.
5663 ;; We can set $PS1 to `tramp-end-of-output' only when the echo has 5666 ;; We can set $PS1 to `tramp-end-of-output' only when the echo has
5664 ;; been disabled. Otherwise, the echo of the command would be 5667 ;; been disabled. Otherwise, the echo of the command would be
5665 ;; regarded as prompt already. 5668 ;; regarded as prompt already.
5666 (tramp-send-command 5669 (tramp-send-command
5667 vec 5670 vec
5668 (format "PROMPT_COMMAND=''; PS1='%s%s%s'; PS2=''; PS3=''" 5671 (format "PS1='%s%s%s'"
5669 tramp-rsh-end-of-line 5672 tramp-rsh-end-of-line
5670 tramp-end-of-output 5673 tramp-end-of-output
5671 tramp-rsh-end-of-line) 5674 tramp-rsh-end-of-line)
5672 t) 5675 t)
5676 (tramp-send-command vec "PS2=''" t)
5677 (tramp-send-command vec "PS3=''" t)
5678 (tramp-send-command vec "PROMPT_COMMAND=''" t)
5673 5679
5674 ;; Try to set up the coding system correctly. 5680 ;; Try to set up the coding system correctly.
5675 ;; CCC this can't be the right way to do it. Hm. 5681 ;; CCC this can't be the right way to do it. Hm.
5676 (tramp-message vec 5 "Determining coding system") 5682 (tramp-message vec 5 "Determining coding system")
5677 (tramp-send-command vec "echo foo ; echo bar" t) 5683 (tramp-send-command vec "echo foo ; echo bar" t)