-
Notifications
You must be signed in to change notification settings - Fork 140
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
Auto enable completion #346
Conversation
Signed-off-by: Wenxuan Zhang <wenxuangm@gmail.com>
Signed-off-by: Wenxuan Zhang <wenxuangm@gmail.com>
87181aa
to
ed1dcfc
Compare
Signed-off-by: Wenxuan Zhang <wenxuangm@gmail.com>
ed1dcfc
to
5c4bc54
Compare
This reverts commit 56e3151.
This pr works for me, but fails in ci because of the lack of
I think it's better to sourcing the |
@carlfriedrich Thanks for the quickly testing! I'm not sure how to avoid the |
Now that I look at it again I think this should actually be fixed in the ZSH completion file. We rely on the git completions being installed, while actually we should have error handling for that in case they are not. @sandr01d Can you take a look if I see that correctly? I am gonna reopen this for discussion. |
Only saw this PR today, sorry for the late reply. I think that the issue this PR is trying to solve has already been solved by #340, where @cjappl found a way to auto enable zsh completions whithout having to source any additional files (be it manually or automatically).
We currently do rely on the git completions being present and simply fail with an exit code of 1 when a user tries to use a completion and they aren't. I guess in this case we should simply print out a user facing error message letting the user now whats going on. |
Yeah, I think we should re-test with the newly merged file and see if there is any difference in what we intend to be the user experience vs how we have it now. I think the latest version is pretty streamlined and also follows the "best practices" i saw in many other zsh completions. The main thing I'd worry about with this PR is actively loading/sourcing the completions on shell startup instead of lazy loading when the completion is requested. TLDR: check out main with the new completion file in your fpath and see if that leaves anything unaccounted for :) |
That sounds reasonable. However, if #340 already provided a better implementation for this kind of problem, I'm gonna close this again. Thanks for your comments! |
Check list
Description
We can enable completions automatically for
zsh
and.bash
Type of change
Test environment