1
0
Fork 0
mirror of https://github.com/romkatv/powerlevel10k.git synced 2024-12-22 15:21:56 +00:00

bug fix: don't hide command execution status on reset-prompt

fixes #171
This commit is contained in:
romkatv 2019-08-16 20:26:28 +02:00
parent e6d0da1c2e
commit 96ba1b6f7d

View file

@ -1151,8 +1151,7 @@ _p9k_custom_prompt() {
################################################################ ################################################################
# Display the duration the command needed to run. # Display the duration the command needed to run.
prompt_command_execution_time() { prompt_command_execution_time() {
(( _p9k_timer_start )) || return (( $+P9K_COMMAND_DURATION_SECONDS )) || return
P9K_COMMAND_DURATION_SECONDS=$((_p9k_timer_end - _p9k_timer_start))
(( P9K_COMMAND_DURATION_SECONDS >= _POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD )) || return (( P9K_COMMAND_DURATION_SECONDS >= _POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD )) || return
if (( P9K_COMMAND_DURATION_SECONDS < 60 )); then if (( P9K_COMMAND_DURATION_SECONDS < 60 )); then
@ -3240,6 +3239,11 @@ _p9k_precmd() {
setopt nopromptbang prompt{cr,percent,sp,subst} setopt nopromptbang prompt{cr,percent,sp,subst}
_p9k_timer_end=EPOCHREALTIME _p9k_timer_end=EPOCHREALTIME
if (( _p9k_timer_start )); then
typeset -gF P9K_COMMAND_DURATION_SECONDS=$((_p9k_timer_end - _p9k_timer_start))
else
unset P9K_COMMAND_DURATION_SECONDS
fi
_p9k_save_status _p9k_save_status
powerlevel9k_refresh_prompt_inplace powerlevel9k_refresh_prompt_inplace
@ -3506,7 +3510,6 @@ _p9k_init_vars() {
typeset -g _p9k_pwd typeset -g _p9k_pwd
typeset -g _p9k_pwd_a typeset -g _p9k_pwd_a
typeset -gF P9K_COMMAND_DURATION_SECONDS
typeset -g P9K_VISUAL_IDENTIFIER typeset -g P9K_VISUAL_IDENTIFIER
typeset -g P9K_CONTENT typeset -g P9K_CONTENT
typeset -g P9K_GAP typeset -g P9K_GAP