aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/net/tramp-sh.el34
1 files changed, 20 insertions, 14 deletions
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index 2d27baf454a..11b1af8116e 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -4769,8 +4769,8 @@ Does not do anything if a connection is already open, but re-opens the
4769connection if a previous connection has died for some reason." 4769connection if a previous connection has died for some reason."
4770 (let ((p (tramp-get-connection-process vec)) 4770 (let ((p (tramp-get-connection-process vec))
4771 (process-name (tramp-get-connection-property vec "process-name" nil)) 4771 (process-name (tramp-get-connection-property vec "process-name" nil))
4772 (process-environment (copy-sequence process-environment)) 4772 (pos (with-current-buffer (tramp-get-connection-buffer vec) (point)))
4773 (pos (with-current-buffer (tramp-get-connection-buffer vec) (point)))) 4773 tmp-process-environment)
4774 4774
4775 ;; If Tramp opens the same connection within a short time frame, 4775 ;; If Tramp opens the same connection within a short time frame,
4776 ;; there is a problem. We shall signal this. 4776 ;; there is a problem. We shall signal this.
@@ -4835,17 +4835,22 @@ connection if a previous connection has died for some reason."
4835 ;; Start new process. 4835 ;; Start new process.
4836 (when (and p (processp p)) 4836 (when (and p (processp p))
4837 (delete-process p)) 4837 (delete-process p))
4838 (setenv "TERM" tramp-terminal-type) 4838 ;; Use a temporary `process-environment', in order not
4839 (setenv "LC_ALL" (tramp-get-local-locale vec)) 4839 ;; to penetrate local processes.
4840 (if (stringp tramp-histfile-override) 4840 (let ((process-environment (copy-sequence process-environment)))
4841 (setenv "HISTFILE" tramp-histfile-override) 4841 (setenv "TERM" tramp-terminal-type)
4842 (if tramp-histfile-override 4842 (setenv "LC_ALL" (tramp-get-local-locale vec))
4843 (progn 4843 (if (stringp tramp-histfile-override)
4844 (setenv "HISTFILE") 4844 (setenv "HISTFILE" tramp-histfile-override)
4845 (setenv "HISTFILESIZE" "0") 4845 (if tramp-histfile-override
4846 (setenv "HISTSIZE" "0")))) 4846 (progn
4847 (setenv "PROMPT_COMMAND") 4847 (setenv "HISTFILE")
4848 (setenv "PS1" tramp-initial-end-of-output) 4848 (setenv "HISTFILESIZE" "0")
4849 (setenv "HISTSIZE" "0"))))
4850 (setenv "PROMPT_COMMAND")
4851 (setenv "PS1" tramp-initial-end-of-output)
4852 (setq tmp-process-environment
4853 (copy-sequence process-environment)))
4849 (unless (stringp tramp-encoding-shell) 4854 (unless (stringp tramp-encoding-shell)
4850 (tramp-error vec 'file-error "`tramp-encoding-shell' not set")) 4855 (tramp-error vec 'file-error "`tramp-encoding-shell' not set"))
4851 (let* ((current-host (system-name)) 4856 (let* ((current-host (system-name))
@@ -4862,7 +4867,8 @@ connection if a previous connection has died for some reason."
4862 ;; This must be done in order to avoid our file 4867 ;; This must be done in order to avoid our file
4863 ;; name handler. 4868 ;; name handler.
4864 (p (let ((default-directory 4869 (p (let ((default-directory
4865 (tramp-compat-temporary-file-directory))) 4870 (tramp-compat-temporary-file-directory))
4871 (process-environment tmp-process-environment))
4866 (apply 4872 (apply
4867 #'start-process 4873 #'start-process
4868 (tramp-get-connection-name vec) 4874 (tramp-get-connection-name vec)