emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 0691fdc: Support zsh as local shell in Tramp (Bug#3


From: Michael Albinus
Subject: [Emacs-diffs] master 0691fdc: Support zsh as local shell in Tramp (Bug#31924)
Date: Wed, 9 Oct 2019 06:58:51 -0400 (EDT)

branch: master
commit 0691fdc410bf53eb82508d23ec19a1d4abda1c2a
Author: Michael Albinus <address@hidden>
Commit: Michael Albinus <address@hidden>

    Support zsh as local shell in Tramp (Bug#31924)
    
    * lisp/net/tramp-sh.el (tramp-sh-extra-args): Extend zsh
    arguments.  Add :version.
    (tramp-maybe-open-connection): Use extra args for
    `tramp-encoding-shell'.  (Bug#31924)
---
 lisp/net/tramp-sh.el | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index a53eea4..2e57f7e 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -537,7 +537,7 @@ based on the Tramp and Emacs versions, and should not be 
set here."
 ;;;###tramp-autoload
 (defcustom tramp-sh-extra-args
   '(("/bash\\'" . "-norc -noprofile")
-    ("/zsh\\'" . "-f +Z"))
+    ("/zsh\\'" . "-f +Z -V"))
   "Alist specifying extra arguments to pass to the remote shell.
 Entries are (REGEXP . ARGS) where REGEXP is a regular expression
 matching the shell file name and ARGS is a string specifying the
@@ -547,6 +547,7 @@ This variable is only used when Tramp needs to start up 
another shell
 for tilde expansion.  The extra arguments should typically prevent the
 shell from reading its init file."
   :group 'tramp
+  :version "27.1"
   :type '(alist :key-type regexp :value-type string))
 
 (defconst tramp-actions-before-shell
@@ -4869,6 +4870,7 @@ connection if a previous connection has died for some 
reason."
                     ;; W32 systems.
                     (process-coding-system-alist nil)
                     (coding-system-for-read nil)
+                    (extra-args (tramp-get-sh-extra-args tramp-encoding-shell))
                     ;; This must be done in order to avoid our file
                     ;; name handler.
                     (p (let ((default-directory
@@ -4877,10 +4879,11 @@ connection if a previous connection has died for some 
reason."
                           #'start-process
                           (tramp-get-connection-name vec)
                           (tramp-get-connection-buffer vec)
-                          (if tramp-encoding-command-interactive
-                              (list tramp-encoding-shell
-                                    tramp-encoding-command-interactive)
-                            (list tramp-encoding-shell))))))
+                          (append
+                           (list tramp-encoding-shell)
+                           (and tramp-encoding-command-interactive
+                                (list tramp-encoding-command-interactive))
+                           (and extra-args (split-string extra-args)))))))
 
                ;; Set sentinel and query flag.  Initialize variables.
                (set-process-sentinel p #'tramp-process-sentinel)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]