Fixes prompt color

pull/1449/head
David Farrell 2019-11-06 18:11:53 -08:00
parent 546b4e948f
commit 8d5233ac19
No known key found for this signature in database
GPG Key ID: 1CCA28D0E300B56F
1 changed files with 9 additions and 2 deletions

View File

@ -233,8 +233,15 @@ function __powerline_prompt_command {
done
[[ "${last_status}" -ne 0 ]] && __powerline_left_segment $(__powerline_last_status_prompt ${last_status})
[[ -n "${LEFT_PROMPT}" ]] && [[ -n "${POWERLINE_LEFT_LAST_SEGMENT_PROMPT_CHAR}" ]] && LEFT_PROMPT+="$(set_color - ${LAST_SEGMENT_COLOR})${POWERLINE_LEFT_LAST_SEGMENT_PROMPT_CHAR}${normal}"
[[ -n "${LEFT_PROMPT}" ]] && LEFT_PROMPT+="$(set_color ${LAST_SEGMENT_COLOR} -)${separator_char}${normal}"
# By default we try to match the prompt to the adjacent segment's background color,
# but when part of the prompt exists within that segment, we instead match the foreground color.
local prompt_color="$(set_color ${LAST_SEGMENT_COLOR} -)"
if [[ -n "${LEFT_PROMPT}" ]] && [[ -n "${POWERLINE_LEFT_LAST_SEGMENT_PROMPT_CHAR}" ]]; then
LEFT_PROMPT+="$(set_color - ${LAST_SEGMENT_COLOR})${POWERLINE_LEFT_LAST_SEGMENT_PROMPT_CHAR}"
prompt_color="${normal}"
fi
[[ -n "${LEFT_PROMPT}" ]] && LEFT_PROMPT+="${prompt_color}${separator_char}${normal}"
PS1="${LEFT_PROMPT} "