summaryrefslogtreecommitdiff
path: root/lisp/net
diff options
context:
space:
mode:
authorMichael Albinus <michael.albinus@gmx.de>2020-05-04 10:43:58 +0200
committerMichael Albinus <michael.albinus@gmx.de>2020-05-04 10:43:58 +0200
commit221e6a9bcdd50a3a134f09840f4a894ff73fb3e6 (patch)
treec029a6af9a97fab6ae29e926682434e9d4111c62 /lisp/net
parent106936415d2892fc373842b3aedd805096fc9e0e (diff)
downloademacs-221e6a9bcdd50a3a134f09840f4a894ff73fb3e6.tar.gz
Fix setting of INSIDE_EMACS in Tramp
* lisp/net/tramp-sh.el (tramp-sh-handle-make-process) (tramp-sh-handle-process-file, tramp-open-shell): Set proper INSIDE_EMACS environment variable.
Diffstat (limited to 'lisp/net')
-rw-r--r--lisp/net/tramp-sh.el12
1 files changed, 11 insertions, 1 deletions
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index 21ef1efa0d4..592dcf67159 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -2912,6 +2912,11 @@ STDERR can also be a file name."
(setq uenv (cons elt uenv)))))))
(command
(when (stringp program)
+ (setenv-internal
+ env "INSIDE_EMACS"
+ (concat (or (getenv "INSIDE_EMACS") emacs-version)
+ ",tramp:" tramp-version)
+ 'keep)
(format "cd %s && %s exec %s %s env %s %s"
(tramp-shell-quote-argument localname)
(if uenv
@@ -3061,6 +3066,11 @@ STDERR can also be a file name."
(if (tramp-get-env-with-u-option v)
(setq env (append `("-u" ,elt) env))
(setq uenv (cons elt uenv))))))
+ (setenv-internal
+ env "INSIDE_EMACS"
+ (concat (or (getenv "INSIDE_EMACS") emacs-version)
+ ",tramp:" tramp-version)
+ 'keep)
(when env
(setq command
(format
@@ -4169,7 +4179,7 @@ file exists and nonzero exit status otherwise."
"exec env TERM='%s' INSIDE_EMACS='%s,tramp:%s' "
"ENV=%s %s PROMPT_COMMAND='' PS1=%s PS2='' PS3='' %s %s"))
tramp-terminal-type
- emacs-version tramp-version ; INSIDE_EMACS
+ (or (getenv "INSIDE_EMACS") emacs-version) tramp-version
(or (getenv-internal "ENV" tramp-remote-process-environment) "")
(if (stringp tramp-histfile-override)
(format "HISTFILE=%s"