Allow setting a cache file name suffix, e.g. "-${TERM}"

When mixing tmux (TERM=tmux-256color) and native terminal windows/tabs
(e.g. TERM=xterm-kitty), since they share the same instant prompt cache
files, the cache files are invalidated every time I start a new Zsh in a
different $TERM [1].

People who have this issue can set _P10K_CACHE_SUFFIX="-${TERM}" to work
around it.

[1] e2db860745
This commit is contained in:
Frederick Zhang 2024-06-17 10:23:09 +10:00
commit 82fdf6848d
No known key found for this signature in database
GPG key ID: 980A192C361BE1AE
3 changed files with 7 additions and 7 deletions

View file

@ -53,7 +53,7 @@ function _p9k_init_locale() {
(( $+functions[_p9k_setup] )) && _p9k_setup
return 0
fi
typeset -gr __p9k_dump_file=${XDG_CACHE_HOME:-~/.cache}/p10k-dump-${(%):-%n}.zsh
typeset -gr __p9k_dump_file=${XDG_CACHE_HOME:-~/.cache}/p10k-dump-${(%):-%n}${_P10K_CACHE_SUFFIX}.zsh
if [[ $__p9k_dump_file != $__p9k_instant_prompt_dump_file ]] && (( ! $+functions[_p9k_preinit] )) && source $__p9k_dump_file 2>/dev/null && (( $+functions[_p9k_preinit] )); then
_p9k_preinit
fi