From f4afef6fa9749e23ae8531b36b7c5039f7bac52f Mon Sep 17 00:00:00 2001 From: Dries De Peuter Date: Wed, 27 Dec 2023 23:01:21 +0100 Subject: [PATCH] fix: mute notifications over ssh --- auto-notify.plugin.zsh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/auto-notify.plugin.zsh b/auto-notify.plugin.zsh index b908913..64174b9 100644 --- a/auto-notify.plugin.zsh +++ b/auto-notify.plugin.zsh @@ -77,6 +77,12 @@ function _is_auto_notify_ignored() { # Remove leading whitespace target_command="$(echo "$target_command" | sed -e 's/^ *//')" + # If the command is being run over SSH, then ignore it + if [[ -n ${SSH_CLIENT-} || -n ${SSH_TTY-} || -n ${SSH_CONNECTION-} ]]; then + print "yes" + return + fi + # Remove sudo prefix from command if detected if [[ "$target_command" == "sudo "* ]]; then target_command="${target_command/sudo /}"