bugfix: powerline - IFS doesnt split \x20 in prompt on some machines

pull/891/head
Tim Noise 2017-01-30 06:10:28 +11:00
parent 3d4c46bd12
commit 6e1f389952
1 changed files with 4 additions and 0 deletions

View File

@ -154,12 +154,16 @@ function __powerline_prompt_command {
LEFT_PROMPT+="$(set_color ${PROMPT_DISTRO_LOGO_COLOR} ${PROMPT_DISTRO_LOGO_COLORBG})${PROMPT_DISTRO_LOGO}$(set_color - -)" LEFT_PROMPT+="$(set_color ${PROMPT_DISTRO_LOGO_COLOR} ${PROMPT_DISTRO_LOGO_COLORBG})${PROMPT_DISTRO_LOGO}$(set_color - -)"
fi fi
local OLD_IFS="${IFS}"; IFS=" "
## left prompt ## ## left prompt ##
for segment in $POWERLINE_PROMPT; do for segment in $POWERLINE_PROMPT; do
local info="$(__powerline_${segment}_prompt)" local info="$(__powerline_${segment}_prompt)"
[[ -n "${info}" ]] && __powerline_left_segment "${info}" [[ -n "${info}" ]] && __powerline_left_segment "${info}"
done done
IFS="${OLD_IFS}"
[[ "${last_status}" -ne 0 ]] && __powerline_left_segment $(__powerline_last_status_prompt ${last_status}) [[ "${last_status}" -ne 0 ]] && __powerline_left_segment $(__powerline_last_status_prompt ${last_status})
[[ -n "${LEFT_PROMPT}" ]] && LEFT_PROMPT+="$(set_color ${LAST_SEGMENT_COLOR} -)${separator_char}${normal}" [[ -n "${LEFT_PROMPT}" ]] && LEFT_PROMPT+="$(set_color ${LAST_SEGMENT_COLOR} -)${separator_char}${normal}"