;;;###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
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
;; 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
#'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)