aboutsummaryrefslogtreecommitdiff
path: root/internal/p10k.zsh
diff options
context:
space:
mode:
authorromkatv <roman.perepelitsa@gmail.com>2019-08-16 21:26:28 +0300
committerromkatv <roman.perepelitsa@gmail.com>2019-08-16 21:26:28 +0300
commit96ba1b6f7d54b455c008b61318c97ec0965b0033 (patch)
tree7540e0977bfa347b8d3297a49d8d6f214b834d92 /internal/p10k.zsh
parente6d0da1c2e1b95e2a0169b7abcd6ef8b7650b4bf (diff)
bug fix: don't hide command execution status on reset-prompt
fixes #171
Diffstat (limited to 'internal/p10k.zsh')
-rwxr-xr-xinternal/p10k.zsh9
1 files changed, 6 insertions, 3 deletions
diff --git a/internal/p10k.zsh b/internal/p10k.zsh
index 0c45ef5c..5e8d7a27 100755
--- a/internal/p10k.zsh
+++ b/internal/p10k.zsh
@@ -1151,8 +1151,7 @@ _p9k_custom_prompt() {
################################################################
# Display the duration the command needed to run.
prompt_command_execution_time() {
- (( _p9k_timer_start )) || return
- P9K_COMMAND_DURATION_SECONDS=$((_p9k_timer_end - _p9k_timer_start))
+ (( $+P9K_COMMAND_DURATION_SECONDS )) || return
(( P9K_COMMAND_DURATION_SECONDS >= _POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD )) || return
if (( P9K_COMMAND_DURATION_SECONDS < 60 )); then
@@ -3240,6 +3239,11 @@ _p9k_precmd() {
setopt nopromptbang prompt{cr,percent,sp,subst}
_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
powerlevel9k_refresh_prompt_inplace
@@ -3506,7 +3510,6 @@ _p9k_init_vars() {
typeset -g _p9k_pwd
typeset -g _p9k_pwd_a
- typeset -gF P9K_COMMAND_DURATION_SECONDS
typeset -g P9K_VISUAL_IDENTIFIER
typeset -g P9K_CONTENT
typeset -g P9K_GAP