diff options
| author | Michael Albinus | 2019-10-09 12:58:43 +0200 |
|---|---|---|
| committer | Michael Albinus | 2019-10-09 12:58:43 +0200 |
| commit | 0691fdc410bf53eb82508d23ec19a1d4abda1c2a (patch) | |
| tree | 6c1d5bd6b586c8d0c601ca39ff442228701961d2 | |
| parent | 76a9f03ca629d3e5a596c3aa7f62a4649ac2ae8a (diff) | |
| download | emacs-0691fdc410bf53eb82508d23ec19a1d4abda1c2a.tar.gz emacs-0691fdc410bf53eb82508d23ec19a1d4abda1c2a.zip | |
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)
| -rw-r--r-- | lisp/net/tramp-sh.el | 13 |
1 files changed, 8 insertions, 5 deletions
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." | |||
| 537 | ;;;###tramp-autoload | 537 | ;;;###tramp-autoload |
| 538 | (defcustom tramp-sh-extra-args | 538 | (defcustom tramp-sh-extra-args |
| 539 | '(("/bash\\'" . "-norc -noprofile") | 539 | '(("/bash\\'" . "-norc -noprofile") |
| 540 | ("/zsh\\'" . "-f +Z")) | 540 | ("/zsh\\'" . "-f +Z -V")) |
| 541 | "Alist specifying extra arguments to pass to the remote shell. | 541 | "Alist specifying extra arguments to pass to the remote shell. |
| 542 | Entries are (REGEXP . ARGS) where REGEXP is a regular expression | 542 | Entries are (REGEXP . ARGS) where REGEXP is a regular expression |
| 543 | matching the shell file name and ARGS is a string specifying the | 543 | 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 | |||
| 547 | for tilde expansion. The extra arguments should typically prevent the | 547 | for tilde expansion. The extra arguments should typically prevent the |
| 548 | shell from reading its init file." | 548 | shell from reading its init file." |
| 549 | :group 'tramp | 549 | :group 'tramp |
| 550 | :version "27.1" | ||
| 550 | :type '(alist :key-type regexp :value-type string)) | 551 | :type '(alist :key-type regexp :value-type string)) |
| 551 | 552 | ||
| 552 | (defconst tramp-actions-before-shell | 553 | (defconst tramp-actions-before-shell |
| @@ -4869,6 +4870,7 @@ connection if a previous connection has died for some reason." | |||
| 4869 | ;; W32 systems. | 4870 | ;; W32 systems. |
| 4870 | (process-coding-system-alist nil) | 4871 | (process-coding-system-alist nil) |
| 4871 | (coding-system-for-read nil) | 4872 | (coding-system-for-read nil) |
| 4873 | (extra-args (tramp-get-sh-extra-args tramp-encoding-shell)) | ||
| 4872 | ;; This must be done in order to avoid our file | 4874 | ;; This must be done in order to avoid our file |
| 4873 | ;; name handler. | 4875 | ;; name handler. |
| 4874 | (p (let ((default-directory | 4876 | (p (let ((default-directory |
| @@ -4877,10 +4879,11 @@ connection if a previous connection has died for some reason." | |||
| 4877 | #'start-process | 4879 | #'start-process |
| 4878 | (tramp-get-connection-name vec) | 4880 | (tramp-get-connection-name vec) |
| 4879 | (tramp-get-connection-buffer vec) | 4881 | (tramp-get-connection-buffer vec) |
| 4880 | (if tramp-encoding-command-interactive | 4882 | (append |
| 4881 | (list tramp-encoding-shell | 4883 | (list tramp-encoding-shell) |
| 4882 | tramp-encoding-command-interactive) | 4884 | (and tramp-encoding-command-interactive |
| 4883 | (list tramp-encoding-shell)))))) | 4885 | (list tramp-encoding-command-interactive)) |
| 4886 | (and extra-args (split-string extra-args))))))) | ||
| 4884 | 4887 | ||
| 4885 | ;; Set sentinel and query flag. Initialize variables. | 4888 | ;; Set sentinel and query flag. Initialize variables. |
| 4886 | (set-process-sentinel p #'tramp-process-sentinel) | 4889 | (set-process-sentinel p #'tramp-process-sentinel) |