emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] scratch/tzz/tramp-histfile-override ef6a691: Introduce tra


From: Teodor Zlatanov
Subject: [Emacs-diffs] scratch/tzz/tramp-histfile-override ef6a691: Introduce tramp-histfile-override.
Date: Wed, 17 Dec 2014 19:04:39 +0000

branch: scratch/tzz/tramp-histfile-override
commit ef6a6919d75d49851e157d9f0956434aafc2abb9
Author: Ted Zlatanov <address@hidden>
Commit: Ted Zlatanov <address@hidden>

    Introduce tramp-histfile-override.
    
    * net/tramp-sh.el (tramp-histfile-override): New variable.
    (tramp-open-shell, tramp-maybe-open-connection): Use it.
---
 lisp/net/tramp-sh.el |   17 +++++++++++++++--
 1 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index c4d5e2f..c639af3 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -65,6 +65,15 @@ files conditionalize this setup based on the TERM 
environment variable."
   :type 'string)
 
 ;;;###tramp-autoload
+(defcustom tramp-histfile-override "/dev/null"
+  "Whether the HISTFILE should be overridden to something.  Set
+to nil to disable the override."
+  :group 'tramp
+  :type '(choice (const :tag "Do not override HISTFILE" nil)
+                 (const :tag "Empty the history (/dev/null)" "/dev/null")
+                 (string :tag "Redirect to a file")))
+
+;;;###tramp-autoload
 (defconst tramp-color-escape-sequence-regexp "\e[[;0-9]+m"
   "Escape sequences produced by the \"ls\" command.")
 
@@ -3882,7 +3891,10 @@ 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='' HISTFILE=/dev/null 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)
+              "")
            (tramp-shell-quote-argument tramp-end-of-output)
            shell (or extra-args ""))
        t))
@@ -4603,7 +4615,8 @@ connection if a previous connection has died for some 
reason."
                (delete-process p))
              (setenv "TERM" tramp-terminal-type)
              (setenv "LC_ALL" "en_US.utf8")
-             (setenv "HISTFILE" "/dev/null")
+             (when tramp-histfile-override
+                (setenv "HISTFILE" tramp-histfile-override))
              (setenv "PROMPT_COMMAND")
              (setenv "PS1" tramp-initial-end-of-output)
              (let* ((target-alist (tramp-compute-multi-hops vec))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]