From 546b4e948fc4ce67762bb604fd8f7dea15ce5b8f Mon Sep 17 00:00:00 2001 From: David Farrell Date: Wed, 6 Nov 2019 14:41:15 -0800 Subject: [PATCH] Adds last segment prompt char to powerline default theme --- themes/powerline-naked/powerline-naked.theme.bash | 1 + themes/powerline/powerline.base.bash | 1 + themes/powerline/powerline.theme.bash | 1 + 3 files changed, 3 insertions(+) diff --git a/themes/powerline-naked/powerline-naked.theme.bash b/themes/powerline-naked/powerline-naked.theme.bash index 2ec59747..bc52a054 100644 --- a/themes/powerline-naked/powerline-naked.theme.bash +++ b/themes/powerline-naked/powerline-naked.theme.bash @@ -4,6 +4,7 @@ PROMPT_CHAR=${POWERLINE_PROMPT_CHAR:=""} POWERLINE_LEFT_SEPARATOR=${POWERLINE_LEFT_SEPARATOR:=""} +POWERLINE_LEFT_LAST_SEGMENT_PROMPT_CHAR="" USER_INFO_SSH_CHAR=${POWERLINE_USER_INFO_SSH_CHAR:=" "} USER_INFO_THEME_PROMPT_COLOR=${POWERLINE_USER_INFO_COLOR:=240} diff --git a/themes/powerline/powerline.base.bash b/themes/powerline/powerline.base.bash index eeead59b..a348cd7a 100644 --- a/themes/powerline/powerline.base.bash +++ b/themes/powerline/powerline.base.bash @@ -233,6 +233,7 @@ 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}" PS1="${LEFT_PROMPT} " diff --git a/themes/powerline/powerline.theme.bash b/themes/powerline/powerline.theme.bash index 8ba1adf7..9bcd90b1 100644 --- a/themes/powerline/powerline.theme.bash +++ b/themes/powerline/powerline.theme.bash @@ -5,6 +5,7 @@ PROMPT_CHAR=${POWERLINE_PROMPT_CHAR:=""} POWERLINE_LEFT_SEPARATOR=${POWERLINE_LEFT_SEPARATOR:=""} POWERLINE_LEFT_SEPARATOR_SOFT=${POWERLINE_LEFT_SEPARATOR_SOFT:=""} +POWERLINE_LEFT_LAST_SEGMENT_PROMPT_CHAR=${POWERLINE_LEFT_LAST_SEGMENT_PROMPT_CHAR:=""} USER_INFO_SSH_CHAR=${POWERLINE_USER_INFO_SSH_CHAR:=" "} USER_INFO_THEME_PROMPT_COLOR=${POWERLINE_USER_INFO_COLOR:=32}