No errors happen
I'm getting:
/home/quintasan/.asdf/completions/asdf.bash:68: command not found: complete
on every terminal launch
OS: Ubuntu 18.04
asdf version: v0.7.8-4a3e3d6
zsh version: zsh 5.4.2 (x86_64-ubuntu-linux-gnu)
Interesting. completions/asdf.bash should not be executed by any ZSH setup. Which specific setup have you followed for asdf completions as the documentation point to a number of ways to setup ZSH completions but none direct you to using the asdf.bash script itself.
@jthegedus a couple of Zsh plugins also do this same sourcing of the completion:
https://github.com/kiurchv/asdf.plugin.zsh/blob/master/asdf.plugin.zsh#L5
https://github.com/ohmyzsh/ohmyzsh/blob/master/plugins/asdf/asdf.plugin.zsh#L17
Ah, yes, a number of the asdf plugins will source this as the ZSH completions are new and those plugins have not been updated. I have opened a discussion around how to correctly implement the new completions with the oh-my-zsh asdf plugin https://github.com/ohmyzsh/ohmyzsh/issues/8779
As with the command not found: complete error, complete has been a requirement for the bash completions and these plugins for a few years, so you will need to install bash-completion if it is missing from your system.
:trumpet: :trumpet: :trumpet:
The asdf core team are not the authors of most (if any) of these shell plugins, so we are relying on people from the community to help update these plugins for a better ZSH user experience. If you're familiar with any plugins and have the time to help, it would be much appreciated.
I would advise anyone looking to help to read https://github.com/ohmyzsh/ohmyzsh/issues/8779 as the fpath/compinit lifecycle of the tool the plugin is for is important for the implementation.
Thanks for your patience while we work towards a better ZSH experience for all asdf users.
Chiming in with my experience in case it helps someone track this down:
asdf version: v0.7.6-6207e42
My current dotfiles - see ./zsh/zshrc.symlink
. $HOME/.asdf/asdf.sh after path setup (system/_path.zsh)asdf/asdf.zsh - I moved it into _path because I wanted asdf shims to take precedence over brew versions. $HOME/.asdf/completions/asdf.bash after compinit (asdf/completion.zsh)$ asdf l<tab> autocompletes to list, list-all, and local as expected.
Note: I am not sure that these settings are remotely correct, but they are working.
asdf update (brings me to v0.7.8-4a3e3d6)asdf configuration I am aware of from my .zshrc / etc$ asdf l<tab> produces the following:
~ ➜ asdf l(eval):1: command not found: _bash_complete
asdf
If I source the previous completions/asdf.bash file from above, I get the error that OP experienced, so I think we're running into the same thing overall.
Here's a branch of my dotfiles with the new configuration. I also tried installing bash-completion via homebrew and following the post-install instructions to source that, but it doesn't seem to help.
If I cd into ASDF_DIR, check out 6207e42 (0.7.6), and revert my dotfiles, everything works again. It seems like the issue started occurring for me in 0.7.7 and continues into 0.7.8.
Notes:
OS: MacOS Mojave 10.14.6
zsh version: zsh 5.7.1 (x86_64-apple-darwin17.7.0)
zsh-related homebrew libraries
zplug plugins
Note that I am not using a zsh manager like oh-my-zsh that could be conflicting.
One more angle: I just tried deleting ~/.asdf and reinstalling asdf via Homebrew. I'm still getting the same completion error above on 0.7.8. As far as I can tell, the only asdf-related config I have in my dotfiles is now . $(brew --prefix asdf)/asdf.sh at the end of my .zshrc.
@shipstar Thanks for reporting.
I would recommend only testing with 0.7.6 and 0.7.8 as 0.7.7 performed some compinit commands automatically which was ultimately determined to be detrimental.
As with your specific error of asdf l(eval):1: command not found: _bash_complete, the complete command is never used in the ZSH completions and has always appeared in the Bash completions, so I would think that there are some latent config values somewhere in your shell.
It seems like the issue started occurring for me in 0.7.7 and continues into 0.7.8.
I would also suggest looking for and deleting any ~/.zcompdump* as mentioned above 0.7.7 ran compinit which may affect the rest of your setup.
Thanks for the update on 0.7.7 - will skip that version.
I did have a ~/.zcompdump file, which I removed, but I'm still seeing the same issue in a fresh terminal.
Assuming I do have some latent bash config values hanging around, any ideas why zsh autocompletion is working for other tools but not asdf? Seems odd that nothing else would be throwing the same error.
I'll keep digging and report back if I figure it out!
EDIT: I know dotfiles can be a tangled mess, so not expecting specific help with my situation. Just trying to understand the variables in play here, e.g. .zcompdump was helpful to know about.
Possible progress - when I run compinit from a prompt (or as part of my .zshrc) after deleting the .zcompdump file, it generates a new .zcompdump file as expected. Here's the asdf entry from that file:
'asdf' '_bash_complete -F _asdf'
If I change that line in .zcompdump to 'asdf' '_asdf', autocomplete works as expected on 0.7.8.
I'm not sure what's placing the incorrect entry into .zcompdump, though. I do have https://github.com/zsh-users/zsh-completions installed via Homebrew to provide some additional autocompletion options, but I don't see an asdf entry in there that might be conflicting. I also made sure to update that to latest (0.31.0), although it seems to be about 6 months old.
I'll edit my .zcompdump as a workaround for now, but hopefully this helps.
I am also seeing this error.
In my dotfile, I have
$ cat .zshrc.local | grep asdf
source $HOME/.install/asdf/asdf.sh
# source $HOME/.install/asdf/completions/asdf.bash
, and on terminal startup, I am seeing
/home/teodorlu/.install/asdf/completions/asdf.bash:68: command not found: complete
My ZSH config is quite close to a vanilla grml-zsh-config, so not too much weird stuff going on.
I'd also like to use this chance to say thank you for a great, simple version manager! When I was able to replace nvm + similar things for other languages with asdf, my shell startup went from annoying to instant. Thanks!
Reverting to v0.7.6 with
git checkout v0.7.6
in the asdf install folder, I am no longer seeing any errors on startup.
@shipstar That is an interesting find, thanks. Perhaps the way the Brew installation is setting the completions is incorrect. I will test on a macOS machine.
@teodorlu a few questions:
$HOME/.install/asdf/completions/asdf.bash back into the mix?.zcompdump contents for asdf as @shipstar did above?I think the main issue here is the changes to the asdf.sh file between the versions 0.7.6 and 0.7.8. https://github.com/asdf-vm/asdf/compare/v0.7.6...v0.7.8
asdf.sh v0.7.6 performs bashcompinit if your shell is detected to be ZSH, so in your new v0.7.8 setup you should need to run compinit after adding to your fpath and sourcing asdf in your .zshrc. I believe this is the source of some problems, and by extension the issue @shipstar found with .zcompdump asdf entry.
The docs are very confusing atm for ZSH users (to much information on screen) and the migration path from 0.7.6 to 0.7.8 isn't documented which might be worth also adding to the docs (I am working on an update atm).
Your reports are appreciated. Keep the info coming.
Did you install via Brew?
Nope, I'm on Linux. Ubuntu 18.04. I think I cloned directly into ~/.install/asdf and added the following into my ZSH rc file manually:
source $HOME/.install/asdf/asdf.sh
source $HOME/.install/asdf/completions/asdf.bash
When reverting, are you also adding $HOME/.install/asdf/completions/asdf.bash back into the mix?
I did not add the completions script back into the mix. I can try re-adding them and see what happens.
are you able to share your .zcompdump contents for asdf as @shipstar did above?
Attached: zcompdump.txt. Crossing my fingers that no private stuff has snuck in there ...
Still on 0.7.6, I added source $HOME/.install/asdf/completions/asdf.bash back into my ZSH RC file, and completions seem to be working:

@teodorlu Thanks for the further information. It seems from your zcompdump doesn't have an asdf entry which indicates that you're not running compinit after sourcing asdf or it's completions. I will update the docs with code samples for the common variations, but essentially you want to:
# source asdf
. $HOME/.asdf/asdf.sh
# add asdf completions to fpath
fpath=(${ASDF_DIR}/completions $fpath)
# run compinit
autoload -Uz compinit && compinit
version 0.7.6 didn't require the last two steps as the bash completions and call to compinit were run automatically by the $HOME/.asdf/asdf.sh script.
New docs are out which should make it easier to see the config required for your specific OS/Shell/Install Method combination.
So @Quintasan @goetzc @shipstar @teodorlu was the information in this thread enough for you to each resolve your problems?
@jthegedus since I'm a lazy bum I'm going to wait for https://github.com/ohmyzsh/ohmyzsh/pull/8837 to be merged and report back if it fixes the problem ;)
EDIT: I couldn't wait after all - it works!
I still have the same issue in my .zcompdump file using MacOS 10.14.6 + Homebrew 2.2.13 + asdf v0.7.8. My current workaround is still:
rm ~/.zcompdumpReload terminal, which executes these lines from my .zshrc file:
# from Homebrew instructions linked from asdf docs:
# https://docs.brew.sh/Shell-Completion#configuring-completions-in-zsh
if type brew &>/dev/null; then
FPATH=$(brew --prefix)/share/zsh/site-functions:$FPATH
autoload -Uz compinit
compinit
fi
# the very last line
. $(brew --prefix asdf)/asdf.sh
~/.zcompdump to replace the bad asdf line per my comment aboveThe completions in .zcompdump don't seem to be overridden with any regularity, so this workaround has been OK for me. I only need to go through these steps if I rm ~/.zcompdump.
I'm planning to move to a new computer in the next few weeks, so I'll test from a fresh install and try to report back then.
Despite my minor issues, I just wanted to say that the new docs are much easier to follow. 💯Thanks for making time to improve those!
I will see if I can replicate on my macOS device, thanks @shipstar
@shipstar I was unable to reproduce your issue of
'asdf' '_bash_complete -F _asdf'
on a fresh install of macOS. Let me know if the state of your env changes. There's perhaps more variables of your env we need to dig into to solve this.
Given the OP has had their issue resolved and the docs have been updated to prevent their particular case, I am going to close this issue.
@shipstar please don't hesitate to open a new issue and assign it to me if your problem persists. We can continue debugging your setup there :+1:
Adding this fixed it for me:
autoload -U +X bashcompinit && bashcompinit
@cocoonkid It sounds like you're using the Bash completions. If your Shell is ZSH we have native ZSH completions which the documentation site will help you setup :smile: https://asdf-vm.com/#/core-manage-asdf-vm
Most helpful comment
Adding this fixed it for me:
autoload -U +X bashcompinit && bashcompinit