Skip to content

Commit

Permalink
Merge pull request #53 from NoUseFreak/patch-1
Browse files Browse the repository at this point in the history
Mute notifications over ssh
  • Loading branch information
MichaelAquilina authored Feb 8, 2024
2 parents 22b2c61 + f4afef6 commit f4766d6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions auto-notify.plugin.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -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 /}"
Expand Down

0 comments on commit f4766d6

Please sign in to comment.