-
Couldn't load subscription status.
- Fork 1k
Port zsh shell completion to #compdef - @mcornella #13384
Conversation
I did NOT find this solution, I know @mcornella is quite busy and I wanted to make sure that this was able to be formed into a PR. This solves issue dotnet/sdk#9232
|
Thanks @larson-carter but this is wrong, the whole file should be what I posted, not just the function body. |
|
Also for the future, it's better not to use GitHub mentions in git commits because GitHub sends a message every time the commit appears in a fork. |
Oh wow I didn't know that.
Also, I removed everything except what you committed. It's odd that there is no function body. |
|
@rainersigwald I had no clue that was a thing. Thank You! |
|
+1 to the current version. Should we do something about the filename? Normally completion files are of the form |
|
@dsplaisted @terrajobst @larson-carter is willing to rename but wants to make sure that won't cause conflicts with other scripts. Any issues? |
|
@jongalloway bash completions use the same filename convention: https://github.com/scop/bash-completion/tree/master/completions To avoid conflict, I think we should keep the names as they are. We should configure the installer and the update the manual installation steps to tell users where the files need to go. |
| compctl -K _dotnet_zsh_complete dotnet | ||
| #compdef dotnet | ||
| local completions=("$(dotnet complete "$words")") | ||
| compadd "${(ps:\n:)completions}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey there, coming back to this to add that it should be
compadd -- "${(ps:\n:)completions}"to avoid dash options to be passed to compadd instead of being shown as completion entries.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also we should only call compadd if there are $completions, i.e. if [[ -n "$completions" ]] is true. Otherwise a blank space is called each time a completion is triggered and there are no entries returned.
|
Also, should this be submitted to |
Yes, dotnet/sdk would be the right repo now. |
|
CLI repo has been archived and merged with https://github.com/dotnet/sdk/tree/master/src/Cli. Closing all old PRs in the cli repo to master. |
|
@marcpopMSFT can we move this issue to dotnet/sdk instead? The issue still exists and there's even a PR open in the sdk repo that refers to this issue. |
|
This is a PR. All issues we're previously moved to the SDK repo and as you noted there is a PR open for this and an issue tracking it already. I was just cleaning up old leftover PRs. |
|
Oops. Thanks for correcting me! |
I did NOT find this solution, I know @mcornella is quite busy and I wanted to make sure that this was able to be formed into a PR.
This solves issue dotnet/sdk#9232