prompt builders: reset color between prompt functions

This commit is contained in:
Nicole O'Connor 2023-08-15 12:09:31 -07:00
parent 479805fe2a
commit e29862ff82

View File

@ -4,7 +4,7 @@ typeset -ag rprompt_functions
function prompt_builder () { function prompt_builder () {
result="" result=""
for prompt_func in $prompt_functions; do for prompt_func in $prompt_functions; do
result="${result}$($prompt_func) " result="${result}$($prompt_func)%{$reset_color%} "
done done
# prompt will always end with "% " (or "# " if we're somehow root) # prompt will always end with "% " (or "# " if we're somehow root)
result="${result}%#%{$reset_color%} " result="${result}%#%{$reset_color%} "
@ -14,7 +14,7 @@ function prompt_builder () {
function rprompt_builder () { function rprompt_builder () {
result="" result=""
for rprompt_func in $rprompt_functions; do for rprompt_func in $rprompt_functions; do
result="$($rprompt_func) ${result}" result="$($rprompt_func)%{$reset_color%} ${result}"
done done
result="${result}%{$reset_color%}" result="${result}%{$reset_color%}"
print "${result}" print "${result}"