From 0a9d82780e20e24b6fafc5b2aaefedb0957986c9 Mon Sep 17 00:00:00 2001 From: Benjamin Neff Date: Fri, 1 Dec 2023 17:09:48 +0100 Subject: feat(bgnotify): add option to disable terminal bell (#12077) --- plugins/bgnotify/bgnotify.plugin.zsh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'plugins/bgnotify/bgnotify.plugin.zsh') diff --git a/plugins/bgnotify/bgnotify.plugin.zsh b/plugins/bgnotify/bgnotify.plugin.zsh index 4499d816c..3c0766191 100644 --- a/plugins/bgnotify/bgnotify.plugin.zsh +++ b/plugins/bgnotify/bgnotify.plugin.zsh @@ -27,7 +27,7 @@ function bgnotify_end { # check if Terminal app is not active [[ $(bgnotify_appid) != "$bgnotify_termid" ]] || return - printf '\a' # beep sound + [[ $bgnotify_bell = true ]] && printf '\a' # beep sound bgnotify_formatted "$exit_status" "$bgnotify_lastcmd" "$elapsed" } always { bgnotify_timestamp=0 @@ -136,6 +136,9 @@ function bgnotify { ## Defaults +# enable terminal bell on notify by default +bgnotify_bell=${bgnotify_bell:-true} + # notify if command took longer than 5s by default bgnotify_threshold=${bgnotify_threshold:-5} -- cgit v1.2.3-70-g09d2