From 2ecab18181c8fa1484358a59c88aea3be07c4e71 Mon Sep 17 00:00:00 2001 From: Austen Adler Date: Sun, 29 Mar 2015 00:41:44 -0400 Subject: [PATCH] Modified _lp_reset_runtime --- liquidprompt | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) 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 ]