From 1e3b187d27091784d404523e2f4aa0a1480913cf Mon Sep 17 00:00:00 2001 From: Peter Vacho Date: Tue, 2 Dec 2025 18:59:28 +0100 Subject: [PATCH] Auto-create zsh histfile file if not exists --- home/.config/zsh/rc/history.zsh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/home/.config/zsh/rc/history.zsh b/home/.config/zsh/rc/history.zsh index 66d859b..d693096 100644 --- a/home/.config/zsh/rc/history.zsh +++ b/home/.config/zsh/rc/history.zsh @@ -57,3 +57,8 @@ setopt EXTENDED_HISTORY # beep in ZLE when a widget attempts to access a history entry which isn’t there 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