From a79a412f3abc33edb15678e823c05b26ef7243cd Mon Sep 17 00:00:00 2001 From: Grafcube Date: Sun, 16 Jun 2024 00:21:26 +0530 Subject: [PATCH 1/2] Treat code 130 as success --- auto-notify.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/auto-notify.plugin.zsh b/auto-notify.plugin.zsh index 8709265..ce5276a 100644 --- a/auto-notify.plugin.zsh +++ b/auto-notify.plugin.zsh @@ -54,7 +54,7 @@ function _auto_notify_message() { local urgency="normal" local transient="--hint=int:transient:1" local icon=${AUTO_NOTIFY_ICON_SUCCESS:-""} - if [[ "$exit_code" != "0" ]]; then + if [[ "$exit_code" != "0" ]] && [[ "$exit_code" != "130" ]]; then urgency="critical" transient="" icon=${AUTO_NOTIFY_ICON_FAILURE:-""} From 76a527a66bf2ab5a3cdaf4b548771aae65e25df9 Mon Sep 17 00:00:00 2001 From: Grafcube Date: Mon, 8 Jul 2024 19:53:31 +0530 Subject: [PATCH 2/2] Add a comment explaining why 130 is treated as success --- auto-notify.plugin.zsh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/auto-notify.plugin.zsh b/auto-notify.plugin.zsh index ce5276a..591a47e 100644 --- a/auto-notify.plugin.zsh +++ b/auto-notify.plugin.zsh @@ -54,6 +54,9 @@ function _auto_notify_message() { local urgency="normal" local transient="--hint=int:transient:1" local icon=${AUTO_NOTIFY_ICON_SUCCESS:-""} + # Exit code 130 is returned when a process is terminated with SIGINT. + # Since the user is already interacting with the program, there is no + # need to make the notification persistent. if [[ "$exit_code" != "0" ]] && [[ "$exit_code" != "130" ]]; then urgency="critical" transient=""