Properly detect Zsh shell

There is no need to define custom shell var, when Zsh can be detected by
checking SHELL env var.
This commit is contained in:
Ihor Urazov
2021-01-29 17:04:54 +02:00
committed by Dan Buch
parent f89647bd19
commit 1150c2e180
4 changed files with 8 additions and 9 deletions
+1 -1
View File
@@ -102,7 +102,7 @@ func printCommandSuggestions(commands []*Command, writer io.Writer) {
if command.Hidden {
continue
}
if os.Getenv("_CLI_ZSH_AUTOCOMPLETE_HACK") == "1" {
if strings.Contains(os.Getenv("SHELL"), "zsh") {
for _, name := range command.Names() {
_, _ = fmt.Fprintf(writer, "%s:%s\n", name, command.Usage)
}