Add command duration to the powerline theme family

Fix the __powerline_duration_prompt: location & unused variable `prompt`

Remove the duration segment from powerline* theme defaults

Different color for duration prompt segment
This commit is contained in:
Cristian Lupascu
2021-06-04 15:07:06 +03:00
parent 8c47706139
commit 1e6113f7b7
4 changed files with 10 additions and 0 deletions

View File

@@ -210,6 +210,11 @@ function __powerline_command_number_prompt() {
echo "${COMMAND_NUMBER_THEME_PROMPT_CHAR}\#|${COMMAND_NUMBER_THEME_PROMPT_COLOR}"
}
function __powerline_duration_prompt() {
local duration=$(_command_duration)
[[ -n "$duration" ]] && echo "${duration}|${COMMAND_DURATION_PROMPT_COLOR}"
}
function __powerline_left_segment() {
local params
IFS="|" read -ra params <<< "${1}"