Hi there!
I've just installed asdf for Mac, and every time I start a new zsh it prints the following error:
/Users/user/.asdf/completions/asdf.bash:43: command not found: complete
What can be going wrong?
Thanks in advance!
I'm getting the same error using ZSH on CentOS 7.
This pull request on a different project seems to have a solution:
https://github.com/eddiezane/lunchy/pull/59
Can anyone using zsh confirm which solution is better?
cc: @asdf-vm/maintainers
It's been a while since I haven't used zsh, but #69 should be good!
./completions/asdf.bash into their profiles since it's auto-loaded via ./asdf.sh@dbernheisel I think there are two choices:
completions/_asdf, and avoid sourcing completions/asdf.bash, which is what we were doing before_asdf and use zsh bash compatibility to load completions/asdf.bashI just merged #69, but I believe we still need to source the file as only _asdf would get autoloaded,
and I would rather avoid maintaining bash and zsh completion separately.
The bash completion currently being superior to the zsh one, I don't think it is worth trying to replicate the functionality under _asdf.
So, if you think it is ok (not being a zsh user myself, I want to be sure this fits everyone need),
I think that we can safely remove _asdf from completions and avoid appending the fpath as
we are not using autoloading here.
Great direction. I like the 2nd option as well. A quick test on my system proves it should work without issue.
This should now be fixed :smile:
If you're here because of Google, this thread is super old now and the docs have updated. As of 2020-05-05, do this:
# append completions to fpath
fpath=(${ASDF_DIR}/completions $fpath)
# initialise completions with ZSH's compinit
autoload -Uz compinit && compinit
thanks @dbernheisel , but where should we put that?
@bernardo-martinez Please check the documentation site as @dbernheisel mentions as it will guide you for your exact OS & Shell combination https://asdf-vm.com/#/core-manage-asdf-vm
Most helpful comment
If you're here because of Google, this thread is super old now and the docs have updated. As of 2020-05-05, do this: