From e1873bd0d8c1f2626eb2ef9090172e06e511dfe1 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Tue, 14 Aug 2012 16:48:28 +0200 Subject: [PATCH] * net/tramp-sh.el (tramp-open-shell): Cache the shell name. (tramp-find-shell, tramp-open-connection-setup-interactive-shell): Use cached shell name. --- lisp/ChangeLog | 6 ++++++ lisp/net/tramp-sh.el | 22 +++++++++++++++------- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index fd442e149bf..5bd96d09aad 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2012-08-14 Michael Albinus + + * net/tramp-sh.el (tramp-open-shell): Cache the shell name. + (tramp-find-shell, tramp-open-connection-setup-interactive-shell): + Use cached shell name. + 2012-08-14 Fabián Ezequiel Gallina * progmodes/python.el (python-shell-send-string): diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index a92f4231700..e757247c2a2 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -3599,11 +3599,14 @@ file exists and nonzero exit status otherwise." (setq item (pop alist)) (when (string-match (car item) shell) (setq extra-args (cdr item)))) - (when extra-args (setq shell (concat shell " " extra-args))) (tramp-send-command - vec (format "exec env ENV='' PROMPT_COMMAND='' PS1=%s PS2='' PS3='' %s" - (tramp-shell-quote-argument tramp-end-of-output) shell) + vec (format + "exec env ENV='' PROMPT_COMMAND='' PS1=%s PS2='' PS3='' %s %s" + (tramp-shell-quote-argument tramp-end-of-output) + shell (or extra-args "")) t)) + (tramp-set-connection-property + (tramp-get-connection-process vec) "remote-shell" shell) ;; Setting prompts. (tramp-send-command vec (format "PS1=%s" (tramp-shell-quote-argument tramp-end-of-output)) t) @@ -3614,8 +3617,12 @@ file exists and nonzero exit status otherwise." (defun tramp-find-shell (vec) "Opens a shell on the remote host which groks tilde expansion." (with-current-buffer (tramp-get-buffer vec) - (let ((default-shell (tramp-get-method-parameter - (tramp-file-name-method vec) 'tramp-remote-shell)) + (let ((default-shell + (or + (tramp-get-connection-property + (tramp-get-connection-process vec) "remote-shell" nil) + (tramp-get-method-parameter + (tramp-file-name-method vec) 'tramp-remote-shell))) shell) (setq shell (with-connection-property vec "remote-shell" @@ -3692,8 +3699,9 @@ process to set up. VEC specifies the connection." ;; discarded as well. (tramp-open-shell vec - (tramp-get-method-parameter - (tramp-file-name-method vec) 'tramp-remote-shell)) + (or (tramp-get-connection-property vec "remote-shell" nil) + (tramp-get-method-parameter + (tramp-file-name-method vec) 'tramp-remote-shell))) ;; Disable echo. (tramp-message vec 5 "Setting up remote shell environment") -- 2.39.2