From 29557d41076a9bfd2372e7017c46cfb8a1a030e8 Mon Sep 17 00:00:00 2001 From: David Runge Date: Fri, 26 May 2023 13:17:42 +0200 Subject: zsh: ensure that the parent dir of HISTFILE exists --- .config/zsh/.zshrc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index 3d3542a..b9fcc75 100644 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -185,7 +185,8 @@ unset key{,map,bindings} # History # # The path to the history file -HISTFILE="$HOME/.local/state/zsh/history" +[[ ! -d "${XDG_STATE_HOME:-$HOME/.local/state}/zsh/" ]] && mkdir -p "${XDG_STATE_HOME:-$HOME/.local/state}/zsh/" +HISTFILE="${XDG_STATE_HOME:-$HOME/.local/state}/zsh/history" # The maximum number of events to save in the internal history. HISTSIZE=10000 # The maximum number of events to save in the history file. -- cgit v1.2.3-70-g09d2