Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions docs/core/tools/enable-tab-autocomplete.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: This article teaches you how to enable tab completion for the .NET
author: adegeo
ms.author: adegeo
ms.topic: how-to
ms.date: 11/03/2019
ms.date: 10/13/2022
---

# How to enable TAB completion for the .NET CLI
Expand Down Expand Up @@ -81,14 +81,22 @@ To add tab completion to your **zsh** shell for the .NET CLI, add the following
```zsh
# zsh parameter completion for the dotnet CLI

_dotnet_zsh_complete()
_dotnet_zsh_complete()
{
local completions=("$(dotnet complete "$words")")

reply=( "${(ps:\n:)completions}" )
# If the completion list is empty, just continue with filename selection
if [ -z "$completions" ]
then
_arguments '*::arguments: _normal'
return
fi

# This is not a variable assigment, don't remove spaces!
_values = "${(ps:\n:)completions}"
}

compctl -K _dotnet_zsh_complete dotnet
compdef _dotnet_zsh_complete dotnet
```

## fish
Expand Down