Handle piped commands
This commit is contained in:
parent
51656c43c7
commit
8ec1400032
2 changed files with 17 additions and 1 deletions
|
@ -35,8 +35,14 @@ function _auto_notify_message() {
|
|||
|
||||
function _is_auto_notify_ignored() {
|
||||
local command="$1"
|
||||
# split the command if its been piped one or more times
|
||||
local command_list=("${(@s/|/)command}")
|
||||
local target_command="${command_list[-1]}"
|
||||
# Remove leading whitespace
|
||||
target_command="$(echo "$target_command" | sed -e 's/^ *//')}"
|
||||
|
||||
for ignore in $AUTO_NOTIFY_IGNORE; do
|
||||
if [[ "$command" == "$ignore"* ]]; then
|
||||
if [[ "$target_command" == "$ignore"* ]]; then
|
||||
print "yes"
|
||||
return
|
||||
fi
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue