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

command not found : complete when using bash completion #57

Closed
osaris opened this issue Jul 12, 2015 · 18 comments
Closed

command not found : complete when using bash completion #57

osaris opened this issue Jul 12, 2015 · 18 comments

Comments

@osaris
Copy link
Contributor

osaris commented Jul 12, 2015

Hello,

I have added the code for completion in my .bash_profile file and when I source it, I have the following error :

rvm/gems/ruby-2.0.0-p598/gems/lunchy-0.10.1/lib/../extras/lunchy-completion.bash:18: command not found: complete

Looks like the command used there

complete -F _lunchy -o default lunchy
isn't available on my system (OSX 10.10.4).

Thanks for your help.

@bunnymatic
Copy link
Collaborator

Are you using bash as your shell? If not, this completion script won't help and you should probably leave it out of your profile/bashrc.

If you are using bash, do you have bash_completion installed?
If not, or you can try installing it via homebrew.

You can check to see if bash_completion is available (assuming you have homebrew).

brew list

you should see bash_completion in the list. If not then install it

brew install bash_completion

Then restart your terminal and see if that works.

If you get this far and things are still not working, let us know and we'll try to get it figured out. Please include the version of bash, the list of brew packages.

@osaris
Copy link
Contributor Author

osaris commented Jul 13, 2015

My bad, I'm using zsh :-( Thanks for your quick answer.

@osaris osaris closed this as completed Jul 13, 2015
@bunnymatic
Copy link
Collaborator

i don't know how zsh completion works, but it seems like there must be a mechanism. If you'd like to write a completion script, we'd be happy to roll it in.

@osaris
Copy link
Contributor Author

osaris commented Jul 14, 2015

zsh have a bash completion script compatibility mode, you need to run :

autoload bashcompinit
bashcompinit

before sourcing the bash completion file. I have tested it and it works partially (listing the lunchy command is ok but not listing of the plist files).

I'll investigate and try to find a solution to have a working completion for ZSH.

@osaris osaris reopened this Jul 14, 2015
@osaris
Copy link
Contributor Author

osaris commented Jul 14, 2015

Proposal in #59

bunnymatic added a commit that referenced this issue Jul 14, 2015
@eddiezane
Copy link
Owner

Closed via #59

@ivanyang1984
Copy link

that is cool!

@secbitchris
Copy link

Is there a workaround for ZSH yet?

@bunnymatic
Copy link
Collaborator

Have you tried the latest? It looks like that has been solved by #3236 (referenced above). Try installing the latest version, follow the zsh completion instructions and see if that works.

@fujian26
Copy link

autoload bashcompinit
bashcompinit
I tried this, but it didn't work for me.

@phaberest
Copy link

For those who were not able to make it work, just paste those two lines in your ~/.zshrc file right before the source filethathascompletion.bash line

@Tcharl
Copy link

Tcharl commented Jul 29, 2018

At the end of the zshrc ^^. Putting it on the beginning does not fix the issue

@Marthyn
Copy link

Marthyn commented Nov 1, 2018

autoload bashcompinit
bashcompinit

On top of .zshrc works! 👍

@chrispruitt
Copy link

chrispruitt commented Dec 19, 2018

this is the only thing that worked for me.
got it from here https://github.com/creationix/nvm/pull/1780/files

added this to the top of my .zshrc

autoload -U +X bashcompinit && bashcompinit
autoload -U +X compinit && compinit

@Sn0wl3r0ker
Copy link

this is the only thing that worked for me.
got it from here https://github.com/creationix/nvm/pull/1780/files

added this to the top of my .zshrc

autoload -U +X bashcompinit && bashcompinit
autoload -U +X compinit && compinit

thx bro! finally works~

@kayengar
Copy link

kayengar commented Jul 8, 2021

this is the only thing that worked for me.
got it from here https://github.com/creationix/nvm/pull/1780/files

added this to the top of my .zshrc

autoload -U +X bashcompinit && bashcompinit
autoload -U +X compinit && compinit

This for sure worked!

schlessera pushed a commit to wp-cli/cache-command that referenced this issue Dec 23, 2021
schlessera pushed a commit to wp-cli/checksum-command that referenced this issue Dec 23, 2021
schlessera pushed a commit to wp-cli/wp-cli-tests that referenced this issue Jan 5, 2022
schlessera pushed a commit to wp-cli/eval-command that referenced this issue Jan 5, 2022
schlessera pushed a commit to wp-cli/language-command that referenced this issue Jan 5, 2022
schlessera pushed a commit to wp-cli/package-command that referenced this issue Jan 5, 2022
schlessera pushed a commit to wp-cli/rewrite-command that referenced this issue Jan 5, 2022
schlessera pushed a commit to wp-cli/role-command that referenced this issue Jan 5, 2022
schlessera pushed a commit to wp-cli/shell-command that referenced this issue Jan 5, 2022
schlessera pushed a commit to wp-cli/widget-command that referenced this issue Jan 5, 2022
schlessera pushed a commit to wp-cli/super-admin-command that referenced this issue Jan 5, 2022
schlessera pushed a commit to wp-cli/config-command that referenced this issue Jan 6, 2022
schlessera pushed a commit to wp-cli/automated-tests that referenced this issue Jan 10, 2022
@178me
Copy link

178me commented Jun 24, 2022

autoload bashcompinit && bashcompinit
The same principle, this method will be more concise

danielbachhuber pushed a commit to wp-cli/cron-command that referenced this issue Nov 18, 2022
danielbachhuber pushed a commit to wp-cli/db-command that referenced this issue Nov 18, 2022
danielbachhuber pushed a commit to wp-cli/export-command that referenced this issue Nov 18, 2022
danielbachhuber pushed a commit to wp-cli/import-command that referenced this issue Nov 18, 2022
danielbachhuber pushed a commit to wp-cli/media-command that referenced this issue Nov 18, 2022
danielbachhuber pushed a commit to wp-cli/scaffold-command that referenced this issue Nov 18, 2022
danielbachhuber pushed a commit to wp-cli/search-replace-command that referenced this issue Nov 18, 2022
@martinsotirov
Copy link

this is the only thing that worked for me.
got it from here https://github.com/creationix/nvm/pull/1780/files
added this to the top of my .zshrc

autoload -U +X bashcompinit && bashcompinit
autoload -U +X compinit && compinit

This for sure worked!

This doesn't work for me on macOS 14.2. Neither at the top, nor at the bottom of .zshrc.

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