aboutsummaryrefslogtreecommitdiff
path: root/bash/bashrc
diff options
context:
space:
mode:
Diffstat (limited to 'bash/bashrc')
-rw-r--r--bash/bashrc10
1 files changed, 8 insertions, 2 deletions
diff --git a/bash/bashrc b/bash/bashrc
index af509614..45837f6b 100644
--- a/bash/bashrc
+++ b/bash/bashrc
@@ -8,8 +8,14 @@ if [[ $- != *i* ]] ; then
return
fi
-# Keep around a million lines of history in file
-HISTFILESIZE=$((2 ** 20))
+# If Bash >= 4.3, keep all history in file forever
+if ((BASH_VERSINFO[0] >= 4 && BASH_VERSINFO[1] >= 3)) ; then
+ HISTFILESIZE=-1
+
+# Otherwise, just keep a lot (a million lines)
+else
+ HISTFILESIZE=$((2 ** 20))
+fi
# Keep around a thousand lines of history in memory
HISTSIZE=$((2 ** 10))