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
417 stars 43 forks source link

Very slow command execution on OSX #28

Open noctuid opened 5 years ago

noctuid commented 5 years ago

Issue Details

Loading this plugin greatly slows command execution on OSX. I don't seem to have any issues on Linux but don't know if OS is actually the reason. Without this plugin, ls executes instantly, for example. With it, it takes 2-3 seconds from when I hit enter before I can type in the prompt again.

Operating System (uname -a)

Darwin ga69C02W91MBHTDF 18.7.0 Darwin Kernel Version 18.7.0: Tue Aug 20 16:57:14 PDT 2019; root:xnu-4903.271.2~2/RELEASE_X86_64 x86_64

zsh version (zsh --version)

zsh 5.7.1 (x86_64-apple-darwin18.2.0)

auto-notify version (echo "$AUTO_NOTIFY_VERSION")

0.8.0

How is auto-notify installed?

Zplugin. Same issue with zplug.

Steps to reproduce the issue

Minimal .zshrc that I have the problem with:

if [[ ! -f ~/.zplugin/bin/zplugin.zsh ]]; then
    git clone https://github.com/zdharma/zplugin.git ~/.zplugin/bin
fi

if [[ -f ~/.zplugin/bin/zplugin.zsh ]]; then
    source ~/.zplugin/bin/zplugin.zsh

    zplugin ice wait lucid \
            atload"AUTO_NOTIFY_IGNORE+=(vimpager emacs rn ranger vimus)"
    zplugin light "MichaelAquilina/zsh-auto-notify"
fi

Minimal .zshrc with zplug:

if [[ ! -f ~/.zplug/init.zsh ]]; then
    git clone https://github.com/zplug/zplug ~/.zplug
fi

if [[ -f ~/.zplug/init.zsh ]]; then
    source ~/.zplug/init.zsh

    zplug "MichaelAquilina/zsh-auto-notify"

    # Install plugins if there are plugins that have not been installed
    if ! zplug check --verbose; then
        printf "Install? [y/N]: "
        if read -q; then
            echo; zplug install
        fi
    fi

    # Then, source plugins and add commands to $PATH
    zplug load --verbose
fi
MichaelAquilina commented 4 years ago

I'm afraid I somehow missed this issue sorry about that @noctuid

I'm guessing it's something to do with the different notification systems in use. However it shouldn't need to slow down if its only switching between directories and not sending any notifications.