diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2012-06-05 04:12:02 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2012-06-05 04:12:02 +1200 |
commit | a0bd89aad93f42bdcf7272babb0a2ed8727f9a5b (patch) | |
tree | 15cfcbeb744927a6be938e29d604f07bde5397ba /bash | |
parent | Thousand lines of history per shell (diff) | |
download | dotfiles-a0bd89aad93f42bdcf7272babb0a2ed8727f9a5b.tar.gz dotfiles-a0bd89aad93f42bdcf7272babb0a2ed8727f9a5b.zip |
Safety valve for history bug
Diffstat (limited to 'bash')
-rw-r--r-- | bash/bashrc | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/bash/bashrc b/bash/bashrc index 1583cc55..879ee58b 100644 --- a/bash/bashrc +++ b/bash/bashrc @@ -14,8 +14,16 @@ HISTCONTROL=ignoreboth # Keep the times of the commands in history. HISTTIMEFORMAT='%F %T ' -# Read in and submit history on each newline. -PROMPT_COMMAND="history -n; history -a; ${PROMPT_COMMAND}" +# Read in and submit history on each newline. Broken in old Bash. +case "$BASH_VERSION" in + + # This is broken in older versions of Bash which I occasionally have to + # use; some nasty bug adds screeds of history repeatedly, probably caused + # by the history -n part. Seems okay in versions 3 and up. + [3-4].*) + PROMPT_COMMAND="history -n; history -a; ${PROMPT_COMMAND}" + ;; +esac # Don't check for mail all the time, it's irritating. unset MAILCHECK |