diff --git a/liquidprompt b/liquidprompt index 58b7285..2253d38 100755 --- a/liquidprompt +++ b/liquidprompt @@ -1351,18 +1351,20 @@ fi _lp_reset_runtime() { - if $_LP_SHELL_bash; then - # Compute number of seconds since program was started - _LP_RUNTIME_SECONDS=$((SECONDS - _LP_RUNTIME_LAST_SECONDS)) - - # If no proper command was executed (i.e., someone pressed enter without entering a command), - # reset the runtime counter - [ "$_LP_RUNTIME_COMMAND_EXECUTED" != 1 ] && _LP_RUNTIME_LAST_SECONDS=$SECONDS && _LP_RUNTIME_SECONDS=0 - - # A proper command has been executed if the last command was not related to Liquid Prompt - [ "$BASH_COMMAND" = _lp_set_prompt ] - _LP_RUNTIME_COMMAND_EXECUTED=$? + if $_LP_SHELL_zsh; then + return fi + + # Compute number of seconds since program was started + _LP_RUNTIME_SECONDS=$((SECONDS - _LP_RUNTIME_LAST_SECONDS)) + + # If no proper command was executed (i.e., someone pressed enter without entering a command), + # reset the runtime counter + [ "$_LP_RUNTIME_COMMAND_EXECUTED" != 1 ] && _LP_RUNTIME_LAST_SECONDS=$SECONDS && _LP_RUNTIME_SECONDS=0 + + # A proper command has been executed if the last command was not related to Liquid Prompt + [ "$BASH_COMMAND" = _lp_set_prompt ] + _LP_RUNTIME_COMMAND_EXECUTED=$? } if [ "$LP_ENABLE_RUNTIME" = 1 ]