* net/tramp.el (tramp-encoding-command-interactive): New defcustom.
authorMichael Albinus <michael.albinus@gmx.de>
Fri, 1 Jul 2011 09:14:31 +0000 (11:14 +0200)
committerMichael Albinus <michael.albinus@gmx.de>
Fri, 1 Jul 2011 09:14:31 +0000 (11:14 +0200)
* net/tramp-sh.el (tramp-maybe-open-connection): Use it.

lisp/ChangeLog
lisp/net/tramp-sh.el
lisp/net/tramp.el

index ea317a1..4740b9f 100644 (file)
@@ -1,3 +1,9 @@
+2011-07-01  Michael Albinus  <michael.albinus@gmx.de>
+
+       * net/tramp.el (tramp-encoding-command-interactive): New defcustom.
+
+       * net/tramp-sh.el (tramp-maybe-open-connection): Use it.
+
 2011-07-01  Martin Rudalics  <rudalics@gmx.at>
 
        * window.el (same-window-buffer-names, same-window-regexps)
index e340ddc..acba48b 100644 (file)
@@ -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) " "))
index 9aff060..82d878a 100644 (file)
@@ -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.