Commit 6f8372de authored by Michael Albinus's avatar Michael Albinus

Tramp: Support unsetting HISTFILE.

Fixes: debbugs:19731

* lisp/net/tramp-sh.el (tramp-histfile-override): Add another choice 'unset.
(tramp-open-shell, tramp-maybe-open-connection): Support it.
parent 060dc145
2015-02-02 Michael Albinus <michael.albinus@gmx.de>
* net/tramp-sh.el (tramp-histfile-override): Add another choice 'unset.
(tramp-open-shell, tramp-maybe-open-connection): Support it.
(Bug#19731)
2015-02-02 Thierry Volpiatto <thierry.volpiatto@gmail.com>
* emacs-lisp/package.el (package-delete): Remove package from
......
......@@ -71,12 +71,15 @@ By default, the HISTFILE is set to the \"/dev/null\" value, which
is special on Unix systems and indicates the shell history should
not be logged (this avoids clutter due to Tramp commands).
The symbol `unset' removes any setting of HISTFILE.
If you set this variable to nil, however, the *override* is
disabled, so the history will go to the default storage
location, e.g. \"$HOME/.sh_history\"."
:group 'tramp
:version "25.1"
:type '(choice (const :tag "Do not override HISTFILE" nil)
(const :tag "Unset HISTFILE" 'unset)
(const :tag "Empty the history (/dev/null)" "/dev/null")
(string :tag "Redirect to a file")))
......@@ -3902,9 +3905,13 @@ file exists and nonzero exit status otherwise."
;; the prompt in /bin/bash, it must be discarded as well.
(tramp-send-command
vec (format
"exec env ENV=''%s PROMPT_COMMAND='' PS1=%s PS2='' PS3='' %s %s"
"exec env ENV='' %s PROMPT_COMMAND='' PS1=%s PS2='' PS3='' %s %s"
(if tramp-histfile-override
(concat " HISTFILE=" tramp-histfile-override)
(concat
"HISTFILE="
(if (eq tramp-histfile-override 'unset)
""
(tramp-shell-quote-argument tramp-histfile-override))))
"")
(tramp-shell-quote-argument tramp-end-of-output)
shell (or extra-args ""))
......@@ -4628,7 +4635,9 @@ connection if a previous connection has died for some reason."
(setenv "TERM" tramp-terminal-type)
(setenv "LC_ALL" "en_US.utf8")
(when tramp-histfile-override
(setenv "HISTFILE" tramp-histfile-override))
(setenv "HISTFILE"
(and (not (eq tramp-histfile-override 'unset))
tramp-histfile-override)))
(setenv "PROMPT_COMMAND")
(setenv "PS1" tramp-initial-end-of-output)
(let* ((target-alist (tramp-compute-multi-hops vec))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment