summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoman Perepelitsa <roman.perepelitsa@gmail.com>2022-07-20 12:12:37 +0300
committerRoman Perepelitsa <roman.perepelitsa@gmail.com>2022-07-20 12:12:37 +0300
commitfd5fa095046233c7b4cddc3f1b7de04aae36f9fe (patch)
treeb1763855cf8a5a3210d7c21c244773d1409daed4
parent7704f6b877663fe85420c1473ffb4aef3df9a1e4 (diff)
fix toolbox segment (#1916)
-rw-r--r--internal/p10k.zsh7
1 files changed, 4 insertions, 3 deletions
diff --git a/internal/p10k.zsh b/internal/p10k.zsh
index 9668c421..7c2037f5 100644
--- a/internal/p10k.zsh
+++ b/internal/p10k.zsh
@@ -5999,7 +5999,7 @@ _p9k_set_instant_prompt() {
[[ -n $RPROMPT ]] || unset RPROMPT
}
-typeset -gri __p9k_instant_prompt_version=46
+typeset -gri __p9k_instant_prompt_version=47
_p9k_dump_instant_prompt() {
local user=${(%):-%n}
@@ -8280,9 +8280,10 @@ _p9k_init_toolbox() {
local name=(${(Q)${${(@M)${(f)"$(</run/.containerenv)"}:#name=*}#name=}})
[[ ${#name} -eq 1 && -n ${name[1]} ]] || return 0
typeset -g P9K_TOOLBOX_NAME=${name[1]}
- elif [[ -n $DISTROBOX_ENTER_PATH && -n $HOST ]]; then
+ elif [[ -n $DISTROBOX_ENTER_PATH ]]; then
local name=${(%):-%m}
- if [[ $name == $NAME* ]]; then
+ # $NAME can be empty, see https://github.com/romkatv/powerlevel10k/pull/1916.
+ if [[ -n $name && $name == $NAME* ]]; then
typeset -g P9K_TOOLBOX_NAME=$name
fi
fi