You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ fhome [tab]
config -- Manage system configuration
event -- Manage events
help h -- Shows a list of commands or help for one command
object o -- Manage objects
but when I run Bash first and then trigger completions, my CLI tools still outputs Zsh-style completions:
$ bash
bash-5.2$ fhome
a commands configuration events h:Shows help:Shows o:Manage objects one system
command config:Manage event:Manage for help list object:Manage of or
Expected behavior
I expect shell completion to work for the current active shell, so this bug won't happen.
Additional context
Maybe we can take a look at how Cobra does it.
This also occurs in v3 alpha, please add appropriate labels
bartekpacia
changed the title
your bug title goes here
Shell completions are broken when login shell is different than currently active shell
Apr 9, 2024
My urfave/cli version is
2.27.1
Checklist
Dependency Management
Describe the bug
Shell completions to show are determined by looking at contents of the
$SHELL
environment variable, which isn't a reliable way to do this because the current login shell isn't always the current active shell.cli/help.go
Lines 153 to 161 in 7656c5f
To reproduce
Here's my simple CLI app with shell completions.
Observed behavior
My shell is Zsh, and when I run:
but when I run Bash first and then trigger completions, my CLI tools still outputs Zsh-style completions:
Expected behavior
I expect shell completion to work for the current active shell, so this bug won't happen.
Additional context
Want to fix this yourself?
Sure!
Run
go version
and paste its output hereRun
go env
and paste its output hereThe text was updated successfully, but these errors were encountered: