summaryrefslogtreecommitdiff
path: root/lisp/net
diff options
context:
space:
mode:
authorMichael Albinus <michael.albinus@gmx.de>2011-07-01 11:14:31 +0200
committerMichael Albinus <michael.albinus@gmx.de>2011-07-01 11:14:31 +0200
commit36b148cf16f468ffb7731c0f1e0c49ceb8a7deb0 (patch)
tree5c6c15a274c78433afee5fa9b95ad84f41e6fbd5 /lisp/net
parentf3078a00412e29aac774f9a6780963313d4aebc9 (diff)
downloademacs-36b148cf16f468ffb7731c0f1e0c49ceb8a7deb0.tar.gz
* net/tramp.el (tramp-encoding-command-interactive): New defcustom.
* net/tramp-sh.el (tramp-maybe-open-connection): Use it.
Diffstat (limited to 'lisp/net')
-rw-r--r--lisp/net/tramp-sh.el8
-rw-r--r--lisp/net/tramp.el10
2 files changed, 16 insertions, 2 deletions
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.