MichaelAquilina / zsh-auto-notify

⏰ ZSH plugin that automatically sends out a notification when a long running task has completed.
GNU General Public License v3.0
415 stars 43 forks source link

Ability to ignore specific subcommands #31

Closed martsa1 closed 4 years ago

martsa1 commented 4 years ago

Issue Details

Please provide the following details when opening an issue:

Operating System (uname -a)

Linux sm-fswbsk013 5.3.0-40-generic #32-Ubuntu SMP Fri Jan 31 20:24:34 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

zsh version (zsh --version)

zsh 5.7.1 (x86_64-ubuntu-linux-gnu)

auto-notify version (echo "$AUTO_NOTIFY_VERSION")

0.8.0

How is auto-notify installed?

Is there a way to ignore specific subcommands? For instance, I would like to ignore pipenv shell, but remain notified of other pipenv commands. For instance, running pipenv lock can take some time, for which I would like a notification, but pipenv shell launches a subshell and can remain open for very long periods, without the need for a notification.

I've tried AUTO_NOTIFY_IGNORE+=("pipenv\ shell"), but I don't see the behaviour I would like.

Is this possible currently? Or would I need to just disable pipenv in its entirety?

MichaelAquilina commented 4 years ago

This should work - I think you've just got an issue with your variable.

Try:

AUTO_NOTIFY_IGNORE+=("pipenv shell")

The quotes are what prevents it from splitting in the first place

e.g.

$ FOO=("hello world" "today")
$ echo ${FOO[1]}                                                                
hello world
echo ${FOO[2]}
today
martsa1 commented 4 years ago

For some reason I am completely unable to reproduce my previous issues, your suggestions work faultlessly.

Thanks for the tip!