From 424577ea8f7e9d2d6ca79a33b3e6218187a94e46 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Fri, 1 Jul 2011 11:14:31 +0200 Subject: [PATCH] * net/tramp.el (tramp-encoding-command-interactive): New defcustom. * net/tramp-sh.el (tramp-maybe-open-connection): Use it. --- lisp/ChangeLog | 6 ++++++ lisp/net/tramp-sh.el | 8 ++++++-- lisp/net/tramp.el | 10 ++++++++++ 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e04d74b17dc..37d3aeffa7a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2011-07-01 Michael Albinus + + * net/tramp.el (tramp-encoding-command-interactive): New defcustom. + + * net/tramp-sh.el (tramp-maybe-open-connection): Use it. + 2011-07-01 Martin Rudalics * window.el (same-window-buffer-names, same-window-regexps) diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index e340ddc6cb0..acba48b8374 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -4291,10 +4291,14 @@ connection if a previous connection has died for some reason." ;; This must be done in order to avoid our file name handler. (p (let ((default-directory (tramp-compat-temporary-file-directory))) - (start-process + (apply + 'start-process (tramp-get-connection-name vec) (tramp-get-connection-buffer vec) - tramp-encoding-shell)))) + (if tramp-encoding-command-interactive + (list tramp-encoding-shell + tramp-encoding-command-interactive) + (list tramp-encoding-shell)))))) (tramp-message vec 6 "%s" (mapconcat 'identity (process-command p) " ")) diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 9aff06031fc..82d878a6fa8 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -159,6 +159,9 @@ For encoding and deocding, commands like the following are executed: This variable can be used to change the \"/bin/sh\" part. See the variable `tramp-encoding-command-switch' for the \"-c\" part. +If the shell must be forced to be interactive, see +`tramp-encoding-command-interactive'. + Note that this variable is not used for remote commands. There are mechanisms in tramp.el which automatically determine the right shell to use for the remote host." @@ -174,6 +177,13 @@ See the variable `tramp-encoding-shell' for more information." :group 'tramp :type 'string) +(defcustom tramp-encoding-command-interactive + (unless (string-match "cmd\\.exe" tramp-encoding-shell) "-i") + "*Use this switch together with `tramp-encoding-shell' for interactive shells. +See the variable `tramp-encoding-shell' for more information." + :group 'tramp + :type '(choice (const nil) string)) + ;;;###tramp-autoload (defvar tramp-methods nil "*Alist of methods for remote files. -- 2.11.4.GIT