diff --git a/themes/powerline/powerline.base.bash b/themes/powerline/powerline.base.bash index 8c983a7b..09f8c9b5 100644 --- a/themes/powerline/powerline.base.bash +++ b/themes/powerline/powerline.base.bash @@ -235,10 +235,16 @@ function __powerline_last_status_prompt { [[ "$1" -ne 0 ]] && echo "${1}|${LAST_STATUS_THEME_PROMPT_COLOR}" } +function __powerline_duration_prompt { + [[ ${#command_duration} -gt 0 ]] && echo "${command_duration}|${LAST_STATUS_THEME_PROMPT_COLOR}" +} + function __powerline_prompt_command { local last_status="$?" ## always the first local separator_char="${POWERLINE_PROMPT_CHAR}" + command_duration=$(_command_duration) + LEFT_PROMPT="" SEGMENTS_AT_LEFT=0 LAST_SEGMENT_COLOR="" diff --git a/themes/powerline/powerline.theme.bash b/themes/powerline/powerline.theme.bash index d897c7c8..85aebb8f 100644 --- a/themes/powerline/powerline.theme.bash +++ b/themes/powerline/powerline.theme.bash @@ -84,6 +84,8 @@ HISTORY_NUMBER_THEME_PROMPT_CHAR=${POWERLINE_HISTORY_NUMBER_CHAR:="#"} COMMAND_NUMBER_THEME_PROMPT_COLOR=${POWERLINE_COMMAND_NUMBER_COLOR:=0} COMMAND_NUMBER_THEME_PROMPT_CHAR=${POWERLINE_COMMAND_NUMBER_CHAR:="#"} -POWERLINE_PROMPT=${POWERLINE_PROMPT:="user_info scm python_venv ruby node cwd"} +COMMAND_DURATION_ICON=${POWERLINE_COMMAND_DURATION_ICON:-' '} + +POWERLINE_PROMPT=${POWERLINE_PROMPT:="user_info scm python_venv ruby node cwd duration"} safe_append_prompt_command __powerline_prompt_command