zsh-users / antigen

The plugin manager for zsh.
http://antigen.sharats.me
MIT License
8.07k stars 279 forks source link

Disabling cache causes issue with git plugin #676

Open markleary opened 6 years ago

markleary commented 6 years ago

Description

I want to configure antigen to use two different themes on same computers depending on the value of TERM_PROGRAM. Use case is I want a more basic theme for a terminal window embedded in my editor. With the default config, setting antigen theme based on TERM_PROGRAM does not quite work. The second terminal opened will always use the theme of the first terminal opened. If I disable the cache with ANTIGEN_CACHE=false, theme switching works but it breaks the git plugin.

Steps to reproduce

Minimal steps to reproduce this behavior. Example:

Create a simple antigen .zshrc file:

ANTIGEN_CACHE=false
source ~/.antigen.zsh
antigen use oh-my-zsh
antigen bundle git
antigen apply

When running the shell, the following is displayed

compdef: unknown command or service: git-diff
compdef: unknown command or service: git-checkout
compdef: unknown command or service: git-checkout
compdef: unknown command or service: git-checkout
compdef: unknown command or service: git-checkout
compdef: unknown command or service: git-checkout
compdef: unknown command or service: git-checkout
compdef: unknown command or service: git-checkout
compdef: unknown command or service: git-checkout
compdef: unknown command or service: git-log
compdef: unknown command or service: git-push

Software version

More information

If you remove the antigen bundle git from .zshrc and manually load the bundle after the shell loads, it works as expected.

stafyniaksacha commented 6 years ago

Got same issue with:

seansfkelley commented 5 years ago

I'm seeing something similar, though without twiddling the theme-switching or caching. compdefs for git before antigen apply were failing, but after antigen apply were not. I tried moving antigen apply up to right after the source:

source /path/to/antigen.zsh
antigen apply
antigen use oh-my-zsh
antigen bundle git

and now it works? The antigen apply docs suggest this is either a bad idea (for performance reasons) or shouldn't work, but in any case, all my plugins and completions seem to be working fine. YMMV?