diff --git a/app_test.go b/app_test.go index 5151a48223..1c444ec926 100644 --- a/app_test.go +++ b/app_test.go @@ -369,7 +369,7 @@ func ExampleApp_Run_bashComplete() { func ExampleApp_Run_zshComplete() { // set args for examples sake os.Args = []string{"greet", "--generate-bash-completion"} - _ = os.Setenv("SHELL", "/usr/bin/zsh") + _ = os.Setenv("0", "/usr/bin/zsh") app := NewApp() app.Name = "greet" diff --git a/help.go b/help.go index 874be941c0..f1b9e7f18f 100644 --- a/help.go +++ b/help.go @@ -150,7 +150,7 @@ func printCommandSuggestions(commands []*Command, writer io.Writer) { if command.Hidden { continue } - if strings.HasSuffix(os.Getenv("SHELL"), "zsh") { + if strings.HasSuffix(os.Getenv("0"), "zsh") { for _, name := range command.Names() { _, _ = fmt.Fprintf(writer, "%s:%s\n", name, command.Usage) }