mirror of
https://github.com/romkatv/powerlevel10k.git
synced 2025-12-18 22:12:32 +01:00
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:
parent
bde5ca4c2a
commit
82fdf6848d
3 changed files with 7 additions and 7 deletions
|
|
@ -6161,7 +6161,7 @@ _p9k_dump_instant_prompt() {
|
|||
local user=${(%):-%n}
|
||||
local root_dir=${__p9k_dump_file:h}
|
||||
local prompt_dir=${root_dir}/p10k-$user
|
||||
local root_file=$root_dir/p10k-instant-prompt-$user.zsh
|
||||
local root_file=$root_dir/p10k-instant-prompt-$user${_P10K_CACHE_SUFFIX}.zsh
|
||||
local prompt_file=$prompt_dir/prompt-${#_p9k__cwd}
|
||||
[[ -d $prompt_dir ]] || mkdir -p $prompt_dir || return
|
||||
[[ -w $root_dir && -w $prompt_dir ]] || return
|
||||
|
|
@ -6461,7 +6461,7 @@ _p9k_dump_instant_prompt() {
|
|||
else
|
||||
local tmpdir=/tmp
|
||||
fi
|
||||
typeset -g __p9k_instant_prompt_output=$tmpdir/p10k-instant-prompt-output-${(%):-%n}-$$
|
||||
typeset -g __p9k_instant_prompt_output=$tmpdir/p10k-instant-prompt-output-${(%):-%n}${_P10K_CACHE_SUFFIX}-$$
|
||||
{ : > $__p9k_instant_prompt_output } || return
|
||||
print -rn -- "${out}${esc}?2004h" || return
|
||||
if (( $+commands[stty] )); then
|
||||
|
|
@ -6476,7 +6476,7 @@ _p9k_dump_instant_prompt() {
|
|||
typeset -g _z4h_saved_screen
|
||||
-z4h-save-screen
|
||||
fi
|
||||
typeset -g __p9k_instant_prompt_dump_file=${XDG_CACHE_HOME:-~/.cache}/p10k-dump-${(%):-%n}.zsh
|
||||
typeset -g __p9k_instant_prompt_dump_file=${XDG_CACHE_HOME:-~/.cache}/p10k-dump-${(%):-%n}${_P10K_CACHE_SUFFIX}.zsh
|
||||
if builtin source $__p9k_instant_prompt_dump_file 2>/dev/null && (( $+functions[_p9k_preinit] )); then
|
||||
_p9k_preinit
|
||||
fi
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue