aboutsummaryrefslogtreecommitdiff
path: root/internal/p10k.zsh
diff options
context:
space:
mode:
authorromkatv <roman.perepelitsa@gmail.com>2019-08-24 13:58:55 +0300
committerromkatv <roman.perepelitsa@gmail.com>2019-08-24 13:58:55 +0300
commitcb1f6c48156e503a85a782194218c38ac28fec4b (patch)
treea99e587fc839ee693c9d7a61c647caa94a1f947d /internal/p10k.zsh
parent08026f50713484f0c301d5e42762beaf0e19cca5 (diff)
make custom prompts more compatible with p9k
Diffstat (limited to 'internal/p10k.zsh')
-rwxr-xr-xinternal/p10k.zsh7
1 files changed, 4 insertions, 3 deletions
diff --git a/internal/p10k.zsh b/internal/p10k.zsh
index 255919a4..0c9948f8 100755
--- a/internal/p10k.zsh
+++ b/internal/p10k.zsh
@@ -1141,9 +1141,10 @@ prompt_host() {
_p9k_custom_prompt() {
local segment_name=${1:u}
local command=POWERLEVEL9K_CUSTOM_${segment_name}
- local -a cmd=("${(@Q)${(z)${(P)command}}}")
- whence $cmd[1] &>/dev/null || return
- local content="$("$cmd[@]")"
+ command=${(P)command}
+ local cmd="${(Q)${(z)command}[1]}"
+ (( $+functions[$cmd] || $+commands[$cmd] )) || return
+ local content="$(eval $command)"
[[ -n $content ]] || return
_p9k_prompt_segment "prompt_custom_$segment_name" $_p9k_color2 $_p9k_color1 "CUSTOM_${segment_name}_ICON" 0 '' "$content"
}