-
Notifications
You must be signed in to change notification settings - Fork 120
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
No completions from programs incl gh
, hugo
and helm
until z4h update
#265
Comments
gh
gh
Hi I just realised that this problem has something to do with programs built with Cobra. This is because I have only observed this in |
What do I need to do to reproduce this problem? Please describe all steps. |
Mb for forgetting: Reproduce steps (for Mac):
I'm not sure but this might possibly be related: spf13/cobra#1534. I tried combing through the zsh4humans source code but I wasn't able to tell when the syntax-highlighting plugin was being sourced so no idea if that's the issue or why it would even be so. |
Please post the minimal |
🤦♂️ I apologise @romkatv it turns out all it took was a quick Thanks for your patience, it'd probably be a good idea to put a note in the btw if you want any help in diagnosing why this is happening and possibly fixing the issue I'll still be here Edit: |
Sometimes you need to restart zsh after installing a new tool in order for the completions for the new command to be enabled. This is true whether you are using zsh4humans or not. You can restart zsh with I'm not aware of any tool requiring
This will make shell slower with no advantages. Don't do this. In general, avoid adding anything to your zsh startup files unless you can clearly see the positive effect of it. Many of the edits I see that people perform on their zsh4humans configs simply make shell slower. I guess they do those edits because they believe the edits do something while in fact they have no observable effects but still take long time to execute. |
I see, however I can definitely confirm that
Assumed correctly then, I guess I'll just stick to running
Steps to reproduce on Mac with fresh install of
Edit: Not very confident anymore that it has something to do with Cobra as |
gh
, hugo
and helm
until z4h update
Thanks! I reproduced this and fixed a bug in zsh4humans (bf252e6). Now completions will be enabled after restarting zsh (e.g., with |
In the future I would recommend abstaining from updating the issue title and description so many times. In this particular case it would've been best if you didn't edit it at all. If you change your mind about something, simply post it as a comment. |
Oh wow what a quick fix! How did you find it so fast? I can confirm that my examples are fixed. Thanks! Could you try these steps? Is it a related issue or something else entirely?
Ah sorry about that. I thought I may have been confusing at the beginning. |
Knowing the code helps. At least 90% of my time spent on issues is trying to induce the reporters to post instructions that would allow me to reproduce their problems. If I can reproduce something, fixing is often easy.
This was "something else entirely". Thanks for the report. Fixed. |
Thanks for all the help! |
Sorry I found another one that I think might be related to the one that was "something else entirely". Try the steps for |
Is there a way to make them all work out of the box? |
I've ran % ls -1 $HOMEBREW_PREFIX/share/zsh/site-functions
_brew
_cargo
_docker
_git
git-completion.bash
In zsh, like in bash, for a command to support custom completions, somebody has to write a completion function for it. If there is no completion function for a command, the default completion function is used, which completes files. Specifically for |
Oh sorry my bad I didn't realise the completions were available only for the other shells. This isn't really an issue anymore but what about using |
Indeed, sometimes it's possible to create a completion function for zsh by piggybacking on the existing completion function for bash. If this is something you are interested in doing for |
Ah ok thank you! |
@romkatv |
I don't know if there is a tutorial for this. |
See latest comment for an up to date description of what the actual issue is
Hi I'm not sure what's going on but for some reason the
gh
completions are not working. It might be related to this? cli/cli#716Please let me know what information I should I should supply.
The text was updated successfully, but these errors were encountered: