浏览代码

fix(bgnotify): make it work with `set -e` (#12111)

Co-authored-by: ipChrisLee <chrisleecn@outlook.com>
Gautam krishna R 4 月之前
父节点
当前提交
9004c177ba
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3 3
      plugins/bgnotify/bgnotify.plugin.zsh

+ 3 - 3
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"