aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Albinus2015-02-02 12:38:36 +0100
committerMichael Albinus2015-02-02 12:38:36 +0100
commit6f8372ded12d52b389527d33232eba7951096d18 (patch)
tree7db2b3179d0e08764aa723a8a697ab5943d9312b
parent060dc145902f048bed22919232ce0e7b0e22d4b1 (diff)
downloademacs-6f8372ded12d52b389527d33232eba7951096d18.tar.gz
emacs-6f8372ded12d52b389527d33232eba7951096d18.zip
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.
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/net/tramp-sh.el15
2 files changed, 18 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 846da3b0dee..fe0a3dba1a0 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
12015-02-02 Michael Albinus <michael.albinus@gmx.de>
2
3 * net/tramp-sh.el (tramp-histfile-override): Add another choice 'unset.
4 (tramp-open-shell, tramp-maybe-open-connection): Support it.
5 (Bug#19731)
6
12015-02-02 Thierry Volpiatto <thierry.volpiatto@gmail.com> 72015-02-02 Thierry Volpiatto <thierry.volpiatto@gmail.com>
2 8
3 * emacs-lisp/package.el (package-delete): Remove package from 9 * emacs-lisp/package.el (package-delete): Remove package from
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index 80a256c8d3b..9a5be77e66d 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -71,12 +71,15 @@ By default, the HISTFILE is set to the \"/dev/null\" value, which
71is special on Unix systems and indicates the shell history should 71is special on Unix systems and indicates the shell history should
72not be logged (this avoids clutter due to Tramp commands). 72not be logged (this avoids clutter due to Tramp commands).
73 73
74The symbol `unset' removes any setting of HISTFILE.
75
74If you set this variable to nil, however, the *override* is 76If you set this variable to nil, however, the *override* is
75disabled, so the history will go to the default storage 77disabled, so the history will go to the default storage
76location, e.g. \"$HOME/.sh_history\"." 78location, e.g. \"$HOME/.sh_history\"."
77 :group 'tramp 79 :group 'tramp
78 :version "25.1" 80 :version "25.1"
79 :type '(choice (const :tag "Do not override HISTFILE" nil) 81 :type '(choice (const :tag "Do not override HISTFILE" nil)
82 (const :tag "Unset HISTFILE" 'unset)
80 (const :tag "Empty the history (/dev/null)" "/dev/null") 83 (const :tag "Empty the history (/dev/null)" "/dev/null")
81 (string :tag "Redirect to a file"))) 84 (string :tag "Redirect to a file")))
82 85
@@ -3902,9 +3905,13 @@ file exists and nonzero exit status otherwise."
3902 ;; the prompt in /bin/bash, it must be discarded as well. 3905 ;; the prompt in /bin/bash, it must be discarded as well.
3903 (tramp-send-command 3906 (tramp-send-command
3904 vec (format 3907 vec (format
3905 "exec env ENV=''%s PROMPT_COMMAND='' PS1=%s PS2='' PS3='' %s %s" 3908 "exec env ENV='' %s PROMPT_COMMAND='' PS1=%s PS2='' PS3='' %s %s"
3906 (if tramp-histfile-override 3909 (if tramp-histfile-override
3907 (concat " HISTFILE=" tramp-histfile-override) 3910 (concat
3911 "HISTFILE="
3912 (if (eq tramp-histfile-override 'unset)
3913 ""
3914 (tramp-shell-quote-argument tramp-histfile-override))))
3908 "") 3915 "")
3909 (tramp-shell-quote-argument tramp-end-of-output) 3916 (tramp-shell-quote-argument tramp-end-of-output)
3910 shell (or extra-args "")) 3917 shell (or extra-args ""))
@@ -4628,7 +4635,9 @@ connection if a previous connection has died for some reason."
4628 (setenv "TERM" tramp-terminal-type) 4635 (setenv "TERM" tramp-terminal-type)
4629 (setenv "LC_ALL" "en_US.utf8") 4636 (setenv "LC_ALL" "en_US.utf8")
4630 (when tramp-histfile-override 4637 (when tramp-histfile-override
4631 (setenv "HISTFILE" tramp-histfile-override)) 4638 (setenv "HISTFILE"
4639 (and (not (eq tramp-histfile-override 'unset))
4640 tramp-histfile-override)))
4632 (setenv "PROMPT_COMMAND") 4641 (setenv "PROMPT_COMMAND")
4633 (setenv "PS1" tramp-initial-end-of-output) 4642 (setenv "PS1" tramp-initial-end-of-output)
4634 (let* ((target-alist (tramp-compute-multi-hops vec)) 4643 (let* ((target-alist (tramp-compute-multi-hops vec))