diff --git a/.zshrc b/.zshrc index a5a62c9..e38a9cb 100644 --- a/.zshrc +++ b/.zshrc @@ -109,6 +109,11 @@ if [ -n "$TMUX_PANE" ]; then hist_dir="${XDG_STATE_HOME:-${HOME}/.local/state}/zsh" [ -d "$hist_dir" ] || mkdir -p "$hist_dir" export HISTFILE="${hist_dir}/histfile.$TMUX_PANE" + + # Ensure some history is defined for the pane for completion + [ -f "$HISTFILE" ] || cp "${HOME}/.histfile" "$HISTFILE" + + # Append to history immediately, rather than waiting for the shell to exit setopt inc_append_history fi