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

Fix dotnet-suggest zsh completion shim #2481

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

arussellk
Copy link

The zsh completion script has a subtle error in which it calls dotnet suggest instead of dotnet-suggest.
This error makes tab completion on zsh non-functional for me.

To trigger the error:

  1. Install dotnet-suggest per the instructions here: https://learn.microsoft.com/en-us/dotnet/standard/commandline/tab-completion
  2. Shim completions in zsh
  3. Reload shell
  4. Trigger completions with % dotnet-suggest <tab>
  5. See the following output (% is the zsh prompt, <tab> indicates when to press the tab key):
% dotnet-suggest <tab>Could not execute because the specified command or file was not found.
        dotnet-suggest
  * You intended to execute a .NET program, but dotnet-get does not exist.^M
  * You intended to run a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH.
  * You misspelled a built-in dotnet command.^M
Possible reasons for this include

The output is from the dotnet tool itself:

% dotnet suggest get
Could not execute because the specified command or file was not found.
Possible reasons for this include:
  * You misspelled a built-in dotnet command.
  * You intended to execute a .NET program, but dotnet-get does not exist.
  * You intended to run a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH.

If I fix the shim (i.e., dotnet suggest -> dotnet-suggest) and reload the shell, the completions work as-expected:

% dotnet-suggest <tab>
--help     -?         /?         get        register
--version  -h         /h         list       script

The bash and powershell scripts correctly use dotnet-suggest:

@arussellk arussellk force-pushed the rk-fix-zsh-completion-shim branch from 97bc186 to b50d37b Compare September 17, 2024 05:30
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

Successfully merging this pull request may close these issues.

1 participant