8000 Fix: Shell completions are broken when login shell is different than currently active shell #1884 by imransolanki · Pull Request #1969 · urfave/cli · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

8000 Fix: Shell completions are broken when login shell is different than currently active shell #1884 #1969

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

Merged
merged 1 commit into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion examples_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ func ExampleCommand_Run_shellComplete_zsh() {

// Simulate a zsh environment and command line arguments
os.Args = []string{"greet", "--generate-shell-completion"}
os.Setenv("SHELL", "/usr/bin/zsh")
os.Setenv("0", "/usr/bin/zsh")

_ = cmd.Run(context.Background(), os.Args)
// Output:
Expand Down
2 changes: 1 addition & 1 deletion help.go
53AB
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,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") {
_, _ = fmt.Fprintf(writer, "%s:%s\n", command.Name, command.Usage)
} else {
_, _ = fmt.Fprintf(writer, "%s\n", command.Name)
Expand Down
Loading
0