asdf: $HOME/.asdf/completions/asdf.bash:68: command not found: complete
Steps to reproduce
- Use zsh
- Install asdf
- Install completions according to documentation
Expected behavior
No errors happen
Actual behavior
I’m getting:
/home/quintasan/.asdf/completions/asdf.bash:68: command not found: complete
on every terminal launch
Environment
OS: Ubuntu 18.04
asdf version: v0.7.8-4a3e3d6
zsh version: zsh 5.4.2 (x86_64-ubuntu-linux-gnu)
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 20
- Comments: 24 (11 by maintainers)
Adding this fixed it for me:
autoload -U +X bashcompinit && bashcompinit
@teodorlu Thanks for the further information. It seems from your
zcompdump
doesn’t have anasdf
entry which indicates that you’re not runningcompinit
after sourcingasdf
or it’s completions. I will update the docs with code samples for the common variations, but essentially you want to:version
0.7.6
didn’t require the last two steps as thebash
completions and call tocompinit
were run automatically by the$HOME/.asdf/asdf.sh
script.🎺 🎺 🎺 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.I have had luck putting this in my
.zprofile
:For some reason I don’t understand the
compinit
andbashcompinit
lines seem to both be necessary.Reverting to
v0.7.6
within the asdf install folder, I am no longer seeing any errors on startup.
Chiming in with my experience in case it helps someone track this down:
Works for me
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
aftercompinit
(asdf/completion.zsh
)$ asdf l<tab>
autocompletes tolist
,list-all
, andlocal
as expected.Note: I am not sure that these settings are remotely correct, but they are working.
Upgrade steps
asdf update
(brings me tov0.7.8-4a3e3d6
)asdf
configuration I am aware of from my .zshrc / etc$ asdf l<tab>
produces the following: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
intoASDF_DIR
, check out6207e42
(0.7.6
), and revert my dotfiles, everything works again. It seems like the issue started occurring for me in0.7.7
and continues into0.7.8
.Notes:
Environment
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.@shipstar I was unable to reproduce your issue of
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 👍
@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!