Clear AUTO_COMMAND in the precmd hook.

precmd is always triggered before a new prompt is returned, but preexec is only called before an actual command is executed.
This means that using builtins (or using ^C or enter) on an empty commandline will result in a new notification for the previous command that has already completed before.
This commit is contained in:
Lars Vierbergen 2019-07-17 22:12:03 +02:00
parent 0985a33107
commit 64855fba1c

View file

@ -54,6 +54,7 @@ function _auto_notify_send() {
if [[ -n "$AUTO_COMMAND" && $elapsed -gt $AUTO_NOTIFY_THRESHOLD ]]; then if [[ -n "$AUTO_COMMAND" && $elapsed -gt $AUTO_NOTIFY_THRESHOLD ]]; then
_auto_notify_message "$AUTO_COMMAND" "$elapsed" _auto_notify_message "$AUTO_COMMAND" "$elapsed"
fi fi
AUTO_COMMAND=""
} }
function _auto_notify_track() { function _auto_notify_track() {