From 4d0efc87aa22f1358cf057825fdb6d7d67f14140 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Bernl=C3=B6hr?= Date: Thu, 11 Jun 2020 10:40:27 +0200 Subject: [PATCH] themes/powerline: Fix POWERLINE_PROMPT is not an array (#37) Authored-by: Jan Bernloehr --- themes/powerline/powerline.base.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/themes/powerline/powerline.base.sh b/themes/powerline/powerline.base.sh index 3b7ade9..346ae68 100644 --- a/themes/powerline/powerline.base.sh +++ b/themes/powerline/powerline.base.sh @@ -148,8 +148,13 @@ function __powerline_prompt_command { SEGMENTS_AT_LEFT=0 LAST_SEGMENT_COLOR="" + # The IFS (internal field seperator) may have been changed outside to not contain + # the space character ' ' whence we need to make sure that the space separated list + # stored in POWERLINE_PROMPT is converted into an array correctly. + IFS=' ' read -r -a POWERLINE_PROMPT_ARRAY <<< "${POWERLINE_PROMPT}" + ## left prompt ## - for segment in $POWERLINE_PROMPT; do + for segment in ${POWERLINE_PROMPT_ARRAY[@]}; do local info="$(__powerline_${segment}_prompt)" [[ -n "${info}" ]] && __powerline_left_segment "${info}" done