Modified _lp_reset_runtime
This commit is contained in:
parent
65c428525d
commit
2ecab18181
24
liquidprompt
24
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 ]
|
||||
|
Loading…
Reference in New Issue
Block a user