1
0
Fork 0
mirror of https://github.com/romkatv/powerlevel10k.git synced 2024-09-25 04:30:46 +00:00

fix custom prompt on ZSH older than 5.2

fixes #96
This commit is contained in:
romkatv 2019-06-29 10:49:02 +02:00
parent b404c1b54e
commit 2ecc0b14c8

View file

@ -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