Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Every source .zshrc add the same values (repeat them) into $fpath #89

Open
kreedz opened this issue Mar 24, 2017 · 1 comment
Open

Every source .zshrc add the same values (repeat them) into $fpath #89

kreedz opened this issue Mar 24, 2017 · 1 comment

Comments

@kreedz
Copy link

kreedz commented Mar 24, 2017

I've noticed that ${fpath} starts to repeat (equal to the number of sourcing) the paths that mentioned in the ~/.zgen/init.zsh. It's normal?
~/.zgen/init.zsh.:

# ### Plugins & Completions
fpath=(/home/kreedz/.zgen/zsh-users/zsh-autosuggestions-develop / ${fpath})

.zshrc:

source ~/.zgen/zgen.zsh
if ! zgen saved; then
    zgen load zsh-users/zsh-autosuggestions zsh-autosuggestions.zsh develop
    zgen save
fi

So if I do source .zshrc thrice than the $fpath will contain next paths (repeated three times):

/home/kreedz/.zgen/zsh-users/zsh-autosuggestions-develop
/home/kreedz/.zgen

Doing zgen reset before every source prevents that.

@Tuurlijk
Copy link

Yes, this is normal. But it will not occur when using zsh in a regular fashion.

What is your use-case for sourcing .zshrc multiple times?

jtt9340 pushed a commit to jtt9340/zgen that referenced this issue Jan 7, 2022
- Create the directory of `init.zsh` if it does not exist
- Do not blindly expand ZGEN_{PREZTO_OPTIONS,COMPLETIONS,LOADED}

Closes tarjoilija#89
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants