Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
5fa75d8e
Commit
5fa75d8e
authored
Oct 14, 2014
by
Michael Albinus
Browse files
* net/tramp-sh.el (tramp-open-connection-setup-interactive-shell):
Reduce the amount of set environment variable commands.
parent
3f8c645c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
7 deletions
+18
-7
lisp/ChangeLog
lisp/ChangeLog
+6
-0
lisp/net/tramp-sh.el
lisp/net/tramp-sh.el
+12
-7
No files found.
lisp/ChangeLog
View file @
5fa75d8e
2014-10-14 Jérémy Compostella <jeremy.compostella@intel.com>
Michael Albinus <michael.albinus@gmx.de>
* net/tramp-sh.el (tramp-open-connection-setup-interactive-shell):
Reduce the amount of set environment variable commands.
2014-10-12 Fabián Ezequiel Gallina <fgallina@gnu.org>
Fix import completion. (Bug#18582)
...
...
lisp/net/tramp-sh.el
View file @
5fa75d8e
...
...
@@ -3955,10 +3955,8 @@ process to set up. VEC specifies the connection."
(
tramp-message
vec
5
"Setting shell prompt"
)
(
tramp-send-command
vec
(
format
"PS1=%s"
(
tramp-shell-quote-argument
tramp-end-of-output
))
t
)
(
tramp-send-command
vec
"PS2=''"
t
)
(
tramp-send-command
vec
"PS3=''"
t
)
(
tramp-send-command
vec
"PROMPT_COMMAND=''"
t
)
vec
(
format
"PS1=%s PS2='' PS3='' PROMPT_COMMAND=''"
(
tramp-shell-quote-argument
tramp-end-of-output
))
t
)
;; Try to set up the coding system correctly.
;; CCC this can't be the right way to do it. Hm.
...
...
@@ -4078,15 +4076,22 @@ process to set up. VEC specifies the connection."
(
let
((
env
(
append
(
when
(
tramp-get-remote-locale
vec
)
; Discard `(nil)'.
`
(
,
(
tramp-get-remote-locale
vec
)))
(
copy-sequence
tramp-remote-process-environment
)))
unset
item
)
unset
vars
item
)
(
while
env
(
setq
item
(
tramp-compat-split-string
(
car
env
)
"="
))
(
setcdr
item
(
mapconcat
'identity
(
cdr
item
)
"="
))
(
if
(
and
(
stringp
(
cdr
item
))
(
not
(
string-equal
(
cdr
item
)
""
)))
(
tramp-send-command
vec
(
format
"%s=%s; export %s"
(
car
item
)
(
cdr
item
)
(
car
item
))
t
)
(
push
(
format
"%s %s"
(
car
item
)
(
cdr
item
))
vars
)
(
push
(
car
item
)
unset
))
(
setq
env
(
cdr
env
)))
(
when
vars
(
tramp-send-command
vec
(
format
"while read var val; do export $var=$val; done <<'%s'\n%s\n%s"
tramp-end-of-heredoc
(
mapconcat
'identity
vars
"\n"
)
tramp-end-of-heredoc
)
t
))
(
when
unset
(
tramp-send-command
vec
(
format
"unset %s"
(
mapconcat
'identity
unset
" "
))
t
))))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment