]> arthur.barton.de Git - ax-zsh.git/commitdiff
history: Make sure HISTFILE is set
authorAlexander Barton <alex@barton.de>
Mon, 24 Aug 2020 08:13:58 +0000 (10:13 +0200)
committerAlexander Barton <alex@barton.de>
Mon, 24 Aug 2020 08:13:58 +0000 (10:13 +0200)
Not setting HISTFILE at all disables the history mechanism completely,
so validate this and set HISTFILE, when not done already on the
system-level, for example.

This somewhat reverts commit 7ec1869f094410a2fa14da065fda0e0421446ada.

default_plugins/history/history.zshrc

index 579d6713c15929cc1769d2522bffea104a49c106..1c2bf378950630e0dea361343097c06b9ff1ab06 100644 (file)
@@ -7,6 +7,8 @@ function clear_history {
        fc -R
 }
 
+[[ -n "$HISTFILE" ]] || HISTFILE="${ZDOTDIR:-$HOME}/.zsh_history"
+
 HISTSIZE=10000
 SAVEHIST=10000