Restore directory completions for subcommands

Fixes #6798

This re-adds some false positives: functions, builtins and abbreviations
are suggested after commands like sudo but I don't think anyone had
complained about that.

(cherry picked from commit 2a89873e6d686fcff1d26d0914a8b9f90b7cc308)
This commit is contained in:
Johannes Altmanninger 2020-03-24 20:10:08 +01:00
parent 31d6ccfd59
commit d4462912e6
3 changed files with 3 additions and 2 deletions

View file

@ -16,6 +16,7 @@ This is a bug fix release containing important fixes since 3.1.0. It
- fixes 256 colors when $TERM starts with xterm, does not include "256color" and $TERM_PROGRAM is not set, as a workaround for old Terminal.app that was misapplied (#6701).
- fixes error spew in the hg prompt when the working directory doesn't exist anymore (#6699)
- fixes hosts with multiple aliases in the ssh config (#6698).
- fixes subcommand tab completion for commands like "watch" where executables that are not in $PATH were not suggested (#6798).
- improves compatibility with macOS code signing
- improves the `flatpak` (#6581) and `kill` (#6636) completions
- plus some typo and link fixes and minor adjustments to the documentation (#6627, #6642, #6646, #6647, #6657)

View file

@ -1,3 +1,3 @@
function __fish_complete_external_command
command find $PATH/ -maxdepth 1 -perm -u+x 2>&- | string match -r '[^/]*$'
complete -C "$argv[1]"
end

View file

@ -49,7 +49,7 @@ function __fish_complete_subcommand -d "Complete subcommand" --no-scope-shadowin
end
if test $allow_functions_and_builtins = false && test (count $subcommand) -eq 1
__fish_complete_external_command
__fish_complete_external_command "$subcommand"
else
printf "%s\n" (complete -C "$subcommand")
end