fish-shell/share/functions/__fish_complete_command.fish
Fabian Boehm 57bd21e7ce __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

(cherry picked from commit b03327f5d2)
2023-10-08 17:15:20 +02:00

13 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