Skip to content

Filename suffix "prioritization" is broken for multiple suffixes #8924

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

Closed
triallax opened this issue Apr 30, 2022 · 1 comment
Closed

Filename suffix "prioritization" is broken for multiple suffixes #8924

triallax opened this issue Apr 30, 2022 · 1 comment
Labels
bug Something that's not working as intended completions
Milestone

Comments

@triallax
Copy link
Contributor

triallax commented Apr 30, 2022

System info

  • Fish version: 3.4.1
  • OS: macOS 12.3.1
  • Terminal: Alacritty 0.10.1 with tmux 3.2a

Bug

A common pattern in Fish completions is something like the following:

complete -c unzip -k -xa '(
__fish_complete_suffix .zip
__fish_complete_suffix .jar
__fish_complete_suffix .aar
)'

The idea is that files with these suffixes would be prioritized over others. However, what actually happens is that only the first suffix is prioritized. See https://asciinema.org/a/M3W6vObHVvm1Ldygwp3Qc352B for a quick demonstration with unzip, but this applies to all completions that use such a pattern.

This bug is reproducible even without third-party customizations.

#8512 may be relevant.

@ridiculousfish ridiculousfish added this to the fish-future milestone May 2, 2022
@floam floam added the bug Something that's not working as intended label Jul 10, 2022
@mqudsi mqudsi closed this as completed in aa65856 Mar 13, 2023
mqudsi pushed a commit that referenced this issue Mar 13, 2023
Before:
* hand write arg parse
* only accepts one suffix

After:
* use `arg_parse` to parse args
* accepts multi suffixes

Closes #9611.

(cherry picked from commit aa65856)
@mqudsi mqudsi modified the milestones: fish-future, fish 3.6.1 Mar 13, 2023
@mqudsi
Copy link
Contributor

mqudsi commented Mar 13, 2023

@zanchey I pushed the fix for this into the 3.6.1 branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something that's not working as intended completions
Projects
None yet
Development

No branches or pull requests

4 participants