Skip to content

complete --force-files does not work without options #7920

@rouge8

Description

@rouge8

fish version: 3.2.2

I'm trying to write completions for magic-wormhole and I'm struggling to complete paths outside of the current directory using __fish_complete_path with this completion file:

complete -e -c wormhole
complete --no-files -c wormhole

complete -c wormhole -l help
complete -c wormhole -l version -n "__fish_no_arguments"

complete -c wormhole -n __fish_use_subcommand -a receive -d "Receive a text message, file, or directory (from 'wormhole send')"

complete -c wormhole -n __fish_use_subcommand -a send -d "Send a text message, file, or directory"
complete -c wormhole -n "__fish_seen_subcommand_from send" -r -a "(__fish_complete_path)"

# This isn't a real option to wormhole but demonstrates the inconsistency
complete -c wormhole -l send -r -a "(__fish_complete_path)"
  • If I type, wormhole send <tab> it starts completing files in the current directory, as expected.
  • If I type wormhole send ~/<tab>, it doesn't complete anything, but I would expect it to complete the contents of my home directory
  • If I type wormhole --send ~/<tab>, it starts completing the contents of my home directory

Is there a way to get wormhole send ~/<tab> to complete the contents of my home directory? I'm also very confused why -a "(__fish_complete_path)" is behaving differently with a long option vs a subcommand.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething that's not working as intended

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions