fix: mute notifications over ssh
This commit is contained in:
parent
22b2c61ed1
commit
f4afef6fa9
1 changed files with 6 additions and 0 deletions
|
@ -77,6 +77,12 @@ function _is_auto_notify_ignored() {
|
||||||
# Remove leading whitespace
|
# Remove leading whitespace
|
||||||
target_command="$(echo "$target_command" | sed -e 's/^ *//')"
|
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
|
# Remove sudo prefix from command if detected
|
||||||
if [[ "$target_command" == "sudo "* ]]; then
|
if [[ "$target_command" == "sudo "* ]]; then
|
||||||
target_command="${target_command/sudo /}"
|
target_command="${target_command/sudo /}"
|
||||||
|
|
Loading…
Add table
Reference in a new issue