From: Michael Albinus Date: Wed, 9 Oct 2019 10:58:43 +0000 (+0200) Subject: Support zsh as local shell in Tramp (Bug#31924) X-Git-Tag: emacs-27.0.90~1191 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=0691fdc410bf53eb82508d23ec19a1d4abda1c2a;p=emacs.git 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) --- diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index a53eea429d6..2e57f7e1c71 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)