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
412 stars 42 forks source link

Some options cannot be set in .zshenv #30

Closed jeffmhubbard closed 4 years ago

jeffmhubbard commented 4 years ago

Issue Details

I tried setting AUTO_NOTIFY_THRESHOLD and AUTO_NOTIFY_WHITELIST in my .zshenv. The whitelist works fine, but threshold doesn't. .zshenv gets sourced before .zshrc, so when the plugin is loaded it overwrites AUTO_NOTIFY_THRESHOLD with the default (also AUTO_NOTIFY_EXPIRE_TIME and AUTO_NOTIFY_IGNORE).

Couldn't/shouldn't these have a corresponding DEFAULT_ instead of being exported? Or at least check that the variable isn't already set.

Operating System (uname -a)

Linux pythos 5.5.1-arch1-1 #1 SMP PREEMPT Sat, 01 Feb 2020 16:38:40 +0000 x86_64 GNU/Linux

zsh version (zsh --version)

zsh 5.7.1 (x86_64-pc-linux-gnu)

auto-notify version (echo "$AUTO_NOTIFY_VERSION")

0.8.0

How is auto-notify installed?

Steps to reproduce the issue

% cat .zshenv|grep AUTO_NOTIFY_THRESHOLD
export AUTO_NOTIFY_THRESHOLD=60
% source .zshenv
% echo $AUTO_NOTIFY_THRESHOLD
60
% exec zsh
% echo $AUTO_NOTIFY_THRESHOLD
10

gist link to your zshrc

MichaelAquilina commented 4 years ago

You are right - the order of where you export these options should ideally not make a difference. The fix is relatively easy so I'll add that when I get the chance

jeffmhubbard commented 4 years ago

I've learned I was using .zshenv all wrong and have moved everything back to .zsrhc. So, not much of an issue anymore.