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
ddev should support zsh autocomplete #327
Comments
Was the title of this supposed to say 'zsh' instead of 'bash'? |
Yes :) |
Love the idea, but this isn't a priority at this time. |
Reopening, because there are zsh users out there and they might like it. Shouldn't be that hard, depending on the level of support in cobra now. |
Maybe you can use in the meantime https://github.com/zsh-users/zsh-autosuggestions for autocomplete suggestions based on your history? |
Nice, thanks @KaffDaddy |
ZSH will be the new standard in OSX Catalina. Would be nice if this gets implemented sooner or later ;-) @KaffDaddy Thanks for this tip :-) |
It shouldn't be too hard to add the limited support cobra offers, and I'm sure the macOS change will pressure cobra and us to get this in. It really isn't very hard from this end. Thanks for chiming in! |
I'd like to bump this issue. Would be really cool to have zsh autocompletion! At best including the custom commands as well. |
Thanks for bumping! |
Ran into this today myself after a Catalina update. |
Hi @rfay, just wondering if there has been any more updates on the auto-complete plugin? Would by really great if this is available! :-) |
Thanks for checking in @karlosb ! It helps us know who wants what! It looks like the reports on spf13/cobra#107 are quite bad, and there doesn't seem to be much going on there. spf13/cobra#646 did get pulled. There were some issues in spf13/cobra#881 that look like they may be somewhat of a stumbling block, but it sounds like within limits the pulled PR is doing OK. So this will be worth looking at :) Thanks! |
Hi @rfay many thanks for the update on this. Are you saying there is an updated version of DDEV that we can try this out? |
No @karlosb it will take some work to integrate the work mentioned above, if it works out we can hope it will be in a future release. |
That's great news for all the zsh Users out there :-) Very much appreciate this! |
For those of you who use zsh, I'd love to have you try out the zsh autocomplete artifacts at #2234 (comment) - I think you'll like them. |
Hi Randy,
How do we get this up and running?
I have updated ddev to v1.14.1 via Homebrew.
I can see some .zip file links in the thread at #2234 (comment) but not sure how to get them installed?
Regards
Karl
… On 5 May 2020, at 15:52, Randy Fay ***@***.***> wrote:
For those of you who use zsh, I'd love to have you try out the zsh autocomplete artifacts at #2234 (comment) <#2234 (comment)> - I think you'll like them.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#327 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ABWPHLGWT6UAPU7NAWMBUOTRQAR3DANCNFSM4DPMVBIQ>.
|
@karlosb thanks for testing. As that comment says,
|
Hi Randy,
Can you advise where the $fpath is located?
… On 5 May 2020, at 17:34, Randy Fay ***@***.***> wrote:
@karlosb <https://github.com/karlosb> thanks for testing. As that comment <#2234 (comment)> says,
To test, please unzip it into your local $fpath, then rm -f ~/.zcompdump && compinit. You should then have zsh autocompletion working
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#327 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ABWPHLFTFQEMX54VBL7EP6DRQA5ZDANCNFSM4DPMVBIQ>.
|
It's an environment variable that zsh uses to figure out where it loads functions from. So This Stack Overflow may help you. I'm a n00b to zsh, so just learning as I go along. |
Yeah good idea, many thanks for the further zsh link, I’ll take a look at this 😃👍
… On 5 May 2020, at 18:25, Randy Fay ***@***.***> wrote:
We should probably let the experts weigh in here. I haven't experimented with ohmyzsh and completions yet. I'll try ohmyzsh before we get to pulling that PR.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Wow, thank you so much @rfay! Looks like it works. @karlosb you can copy this file as ~/.oh-my-zsh/custom/plugins/ddev/_ddev and add |
I think we may be able to have homebrew detect oh-my-zsh and put the _ddev file there. |
Hi @felmab @rfay,
Ah it looks like I needed to keep _ddev within a ‘ddev’ folder within the plugins directory! So many thanks @felmab for the further updates on this.
I’ll give this a go first thing in the morning (UK time) and report straight back. 👍
… On 5 May 2020, at 22:53, Randy Fay ***@***.***> wrote:
I think we may be able to have homebrew detect oh-my-zsh and put the _ddev file there.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
@rfay The usual way is to add a plugin in Oh My ZSH, which can be optionally enabled in .zshrc. Now, I guess homebrew (can't say much about it, being an Archlinux user) could display a message to explain how to enable this plugin if it detects Oh My ZSH is present, or ask users what they want to do about it. Unlike Bash, the situation can be rather complex to deal with, as the user could use plain ZSH, or one of the many ZSH distributions like Oh My ZSH. |
Also use Oh My ZSH - on desktop this is maybe the most commen use case..? I can test with Oh My ZSH if there is anything to test. |
I've sorted the following:
Upated ~/.zshrc file with the plugin 'ddev':
Also added to ~./zshrc Then ran the following:
Quit terminal and reloaded and tried typing: And does not work? |
You only need to install it in ~/.oh-my-zsh/custom/plugins/ddev, not sure a duplicate plugin is a good thing. ~/.oh-my-zsh/plugins/ddev should be reserved for official plugins supported by Oh My ZSH (which is not yet the case).
Looks good.
You don't need that. Oh My ZSH will internally deal with fpath.
Please try hitting tab twice. |
Hi @felmab I have removed the following folder (and it's contents ie. _ddev): Removed the following line from Ran: Restarted terminal. Then tried: Still no luck getting it to work. Any other ideas what may be wrong? |
@karlosb could you give us the output of:
|
Hi @felmab echo $plugins: |
@karlosb Mmmh don't know what to say but noting I have more than one .zcompdump file on my machine, the other one is called .zcompdump-MYHOSTNAME-VERSION. |
Hi @felmab When you type ddev then double tab what list of options do you get?
… On 6 May 2020, at 12:28, felmab ***@***.***> wrote:
@karlosb <https://github.com/karlosb> Mmmh don't know what to say but noting I have more than one .zcompdump file on my machine, the other one is called .zcompdump-MYHOSTNAME-VERSION.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#327 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ABWPHLHQMOEJUB2YWEBTHMDRQFCVRANCNFSM4DPMVBIQ>.
|
|
Many thanks for the confirmation above. I have it working now! The .zcompdump files were not properly deleting from the ~/ directory with the following: So I manually deleted ~/.zcompdump and two other similar files. Ran: Then: and all is now working as expected! |
@rfay do you agree with the inclusion of your code into the Oh My ZSH project? Is it released under an MIT-compatible license? @karlosb @tgaertner, could you review and approve ("+1") this pull request? |
@felmab The autocomplete is generated and would change a bit on every release. I don't object to it being in Oh My Zsh, but OTOH, it won't automatically be maintained that way... I was assuming that homebrew or the install script (or the user) would be putting the autocomplete where it belongs. |
@rfay It would indeed be really cool if you decided to support both plain ZSH and Oh My ZSH. I guess in that case you could add a |
Actually it was really silly of me to focus on Oh My ZSH plugins, dropping the completion file somewhere in |
/usr/local/share/zsh/site-functions also is in my fpath, even though this folder was never created. |
Hi @felmab are you still looking for me to '+1' a pull request, or have things changed? (Sorry I'm pretty new to the whole github pull/review stuff!!!). |
So I prefer to avoid using superuser privileges on installation, so a user-local $fpath entry would be better. If there's a predictable way to put it user-local, that will be great. I don't object to figuring out how to maintain it with Oh My Zsh if that can be kept up to date, etc. |
@karlosb I think I'll just close it since apparently DDEV installer will take care of it. @rfay This is what my $fpath looks like (Archlinux): $HOME/.oh-my-zsh/functions and $HOME/.oh-my-zsh/completions would have been good candidates but they would have to be created and the parent directory is managed by Git (~/.oh-my-zsh/custom is explicitly ignored), so back to creating a custom plugin in that case... |
Or adding an entry in $fpath of course. |
ddev can't add an entry to $fpath in any consistent way, it would mean editing .zshrc, I don't see that happening. I do wish there weren't so many ways to do things with zsh. When #2234 gets reviews and a little more maturity, I'll try out Oh My Zsh and look at the installation options. |
* Bump spf13/cobra to v1.0.0 * Basic generation of zsh, fish, and powershell * Add zsh instructions to install.sh * Make the install_ddev.sh script install zsh completions if possible * Add docs for completions * Create a tarball of completion scripts
What happened (or feature request):
What you expected to happen:
Related source links or issues:
The text was updated successfully, but these errors were encountered: