fish-shell/share/functions/__fish_complete_command.fish
Fabian Boehm b03327f5d2 __fish_complete_command: Fix --foo= logic
This was already supposed to handle `--foo=bar<TAB>` cases, except it
printed the `--foo=` again, causing fish to take that as part of the
token.

See #9538 for a similar thing with __fish_complete_directories.

Fixes #10011
2023-09-10 18:16:41 +02:00

12 lines
396 B
Fish

function __fish_complete_command --description 'Complete using all available commands'
set -l ctoken (commandline -ct)
switch $ctoken
case '*=*'
set ctoken (string split "=" -- $ctoken)
complete -C "$ctoken[2]"
case '-*' # do not try to complete options as commands
return
case '*'
complete -C "$ctoken"
end
end