shell: centralize history config and create history dir

Move HISTFILE/HISTSIZE/SAVEHIST/HISTFILESIZE/HISTCONTROL into the shared
shell/exports as env vars; each shell ignores the other's name-specific
ones. Dedup that can't be an env var stays per-shell: HISTCONTROL=ignoreboth
for bash, setopt hist_ignore_all_dups/hist_ignore_space for zsh.

Also mkdir -p the HISTFILE parent in shell/interactive, so a fresh host
doesn't silently drop history when ~/.cache/shell is absent.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-29 11:49:55 +02:00
parent 634f4950f0
commit ad5a6c98ea
4 changed files with 16 additions and 5 deletions
+3 -3
View File
@@ -12,9 +12,9 @@ setopt autocd # Automatically cd into typed directory.
stty stop undef # Disable ctrl-s to freeze terminal.
setopt interactive_comments
# History in cache directory:
HISTSIZE=10000000
SAVEHIST=10000000
# HISTFILE/HISTSIZE/SAVEHIST come from ~/.config/shell/exports (shared).
# Dedup is a setopt, not an env var (bash's HISTCONTROL=ignoreboth equivalent):
setopt hist_ignore_all_dups hist_ignore_space
# Basic auto/tab complete:
autoload -U compinit