Auto-create zsh histfile file if not exists

This commit is contained in:
Peter Vacho 2025-12-02 18:59:28 +01:00
parent e4b7fe0234
commit 1e3b187d27
No known key found for this signature in database
GPG key ID: 00ACA0D6AF712EC9

View file

@ -57,3 +57,8 @@ setopt EXTENDED_HISTORY
# beep in ZLE when a widget attempts to access a history entry which isnt there # beep in ZLE when a widget attempts to access a history entry which isnt there
unsetopt HIST_BEEP unsetopt HIST_BEEP
# Auto-create the histfile cache directory if it doesn't yet exist
if [ ! -d "$(dirname "$HISTFILE")" ]; then
mkdir -p "$(dirname "$HISTFILE")"
touch "$HISTFILE"
fi