From 64855fba1c1e48008b662af91b37864e0ad4f9ff Mon Sep 17 00:00:00 2001 From: Lars Vierbergen Date: Wed, 17 Jul 2019 22:12:03 +0200 Subject: [PATCH] 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. --- auto-notify.plugin.zsh | 1 + 1 file changed, 1 insertion(+) diff --git a/auto-notify.plugin.zsh b/auto-notify.plugin.zsh index 2f5e27b..7153393 100644 --- a/auto-notify.plugin.zsh +++ b/auto-notify.plugin.zsh @@ -54,6 +54,7 @@ function _auto_notify_send() { if [[ -n "$AUTO_COMMAND" && $elapsed -gt $AUTO_NOTIFY_THRESHOLD ]]; then _auto_notify_message "$AUTO_COMMAND" "$elapsed" fi + AUTO_COMMAND="" } function _auto_notify_track() {