Skip to content
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

generated completion invalid for fish shell #821

Open
nate-duke opened this issue Jan 24, 2025 · 3 comments
Open

generated completion invalid for fish shell #821

nate-duke opened this issue Jan 24, 2025 · 3 comments
Assignees

Comments

@nate-duke
Copy link

Describe the bug
A recent change rendered the generated completion files for the fish shell with a quoting issue. The issue is a pair of single quotes around an asterisk.

complete -c gum -f -n '__fish_seen_subcommand_from choose' -x -l selected -d 'Options that should start as selected (selects all if given '*')'

To Reproduce
Steps to reproduce the behavior:

  1. install gum (i did this via homebrew for linux)
  2. use fish shell
  3. See error

Expected behavior
No parsing errors in completion scripts.

Screenshots

/home/linuxbrew/.linuxbrew/share/fish/vendor_completions.d/gum.fish (line 24): No matches for wildcard ''Options that should start as selected (selects all if given '*')''. See `help wildcards-globbing`.
complete -c gum -f -n '__fish_seen_subcommand_from choose' -x -l selected -d 'Options that should start as selected (selects all if given '*')'
                                                                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
from sourcing file /home/linuxbrew/.linuxbrew/share/fish/vendor_completions.d/gum.fish
        called on line 8 of file ~/.config/fish/config.fish
from sourcing file ~/.config/fish/config.fish
        called during startup
/home/linuxbrew/.linuxbrew/share/fish/vendor_completions.d/gum.fish (line 91): No matches for wildcard ''Options that should start as selected (selects all if given '*')''. See `help wildcards-globbing`.
complete -c gum -f -n '__fish_seen_subcommand_from filter' -x -l selected -d 'Options that should start as selected (selects all if given '*')'
                                                                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
from sourcing file /home/linuxbrew/.linuxbrew/share/fish/vendor_completions.d/gum.fish
        called on line 8 of file ~/.config/fish/config.fish
from sourcing file ~/.config/fish/config.fish
        called during startup
🐟

Desktop (please complete the following information):

  • Debian 12

Additional context
I looked around the completion generation code in the repo but can't pinpoint exactly what changed or where a fix could be performed. I'm not terribly familiar with the codebase.

@nate-duke
Copy link
Author

I ran this down the the following two PRs

#777
#769

@bashbunni
Copy link
Member

Hey @nate-duke looking into the issue further - I was able to get the same output in fish as you listed above, but when I replaced your outer single quotes with double quotes, I don't get an error.

complete -c gum -f -n "__fish_seen_subcommand_from choose" -x -l selected -d "Options that should start as selected (selects all if given '*')"

Can you please let me know if this command works as expected for you? Thanks!

@bashbunni bashbunni self-assigned this Jan 27, 2025
@nate-duke
Copy link
Author

nate-duke commented Jan 27, 2025

yes @bashbunni that works. That's exactly what i did to make my shell load without error. I just wasn't certain what would have to be done in the source e.g:

Selected []string `help:"Options that should start as selected (selects all if given '*')" default:"" env:"GUM_FILTER_SELECTED"`

to result in double quotes in the generated completion files.

Also, to be clear the use of the asterisk in those two places in the referenced pull requests are problematic, at least for the generated fish shell completions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants