1
0
Fork 0
mirror of https://github.com/romkatv/powerlevel10k.git synced 2024-11-22 12:20:07 +00:00

make toolbox segment work with distrobox (#1696)

This commit is contained in:
Roman Perepelitsa 2022-01-02 07:51:53 +01:00
parent ced7788012
commit dd3dcfaf51

View file

@ -8227,14 +8227,17 @@ _p9k_init_ssh() {
} }
_p9k_init_toolbox() { _p9k_init_toolbox() {
[[ -z $P9K_TOOLBOX_NAME && [[ -z $P9K_TOOLBOX_NAME ]] || return 0
-e /run/.toolboxenv && if [[ -f /run/.containerenv && -r /run/.containerenv ]]; then
-f /run/.containerenv && local name=(${(Q)${${(@M)${(f)"$(</run/.containerenv)"}:#name=*}#name=}})
-r /run/.containerenv ]] || return 0 [[ ${#name} -eq 1 && -n ${name[1]} ]] || return 0
local name=(${(Q)${${(@M)${(f)"$(</run/.containerenv)"}:#name=*}#name=}}) typeset -g P9K_TOOLBOX_NAME=${name[1]}
(( ${#name} == 1 )) || return 0 elif [[ -n $DISTROBOX_ENTER_PATH && -n $NAME ]]; then
[[ -n ${name[1]} ]] || return 0 local name=${(%):-%m}
typeset -g P9K_TOOLBOX_NAME=${name[1]} if [[ $name == $NAME* ]]; then
typeset -g P9K_TOOLBOX_NAME=$name
fi
fi
} }
_p9k_must_init() { _p9k_must_init() {