From 9004c177bac951f46ab1ec5b74a8bcfb8e3c686b Mon Sep 17 00:00:00 2001 From: Gautam krishna R Date: Fri, 22 Dec 2023 14:27:23 +0530 Subject: [PATCH] fix(bgnotify): make it work with `set -e` (#12111) Co-authored-by: ipChrisLee --- plugins/bgnotify/bgnotify.plugin.zsh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/bgnotify/bgnotify.plugin.zsh b/plugins/bgnotify/bgnotify.plugin.zsh index 3c0766191..c28a29e19 100644 --- a/plugins/bgnotify/bgnotify.plugin.zsh +++ b/plugins/bgnotify/bgnotify.plugin.zsh @@ -21,11 +21,11 @@ function bgnotify_end { local elapsed=$(( EPOCHSECONDS - bgnotify_timestamp )) # check time elapsed - [[ $bgnotify_timestamp -gt 0 ]] || return - [[ $elapsed -ge $bgnotify_threshold ]] || return + [[ $bgnotify_timestamp -gt 0 ]] || return 0 + [[ $elapsed -ge $bgnotify_threshold ]] || return 0 # check if Terminal app is not active - [[ $(bgnotify_appid) != "$bgnotify_termid" ]] || return + [[ $(bgnotify_appid) != "$bgnotify_termid" ]] || return 0 [[ $bgnotify_bell = true ]] && printf '\a' # beep sound bgnotify_formatted "$exit_status" "$bgnotify_lastcmd" "$elapsed"