aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorromkatv <roman.perepelitsa@gmail.com>2019-06-29 11:49:02 +0300
committerromkatv <roman.perepelitsa@gmail.com>2019-06-29 11:49:02 +0300
commit2ecc0b14c882cebea204fa70cafad4dd008d2199 (patch)
tree0d2a8b3b04bad62c58c64e8292d9cfd36186a8b5
parentb404c1b54e5c0e0ce978e4839c828171178ee824 (diff)
fix custom prompt on ZSH older than 5.2
fixes #96
-rwxr-xr-xinternal/p10k.zsh7
1 files changed, 3 insertions, 4 deletions
diff --git a/internal/p10k.zsh b/internal/p10k.zsh
index 2ea2e430..30d4feb6 100755
--- a/internal/p10k.zsh
+++ b/internal/p10k.zsh
@@ -624,10 +624,9 @@ prompt_host() {
# The 'custom` prompt provides a way for users to invoke commands and display
# the output in a segment.
prompt_custom() {
- local segment_name="${3:u}"
- # Get content of custom segment
- local command="POWERLEVEL9K_CUSTOM_${segment_name}"
- local -a cmd=("${(@Q)${(z)${(P):-POWERLEVEL9K_CUSTOM_${segment_name}}}}")
+ local segment_name=${3:u}
+ local command=POWERLEVEL9K_CUSTOM_${segment_name}
+ local -a cmd=("${(@Q)${(z)${(P)command}}}")
whence $cmd[1] &>/dev/null || return
local content=$("$cmd[@]")
[[ -n $content ]] || return