diff --git a/CHANGELOG.md b/CHANGELOG.md index bcffa33f2..39630695b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/share/functions/__fish_complete_external_command.fish b/share/functions/__fish_complete_external_command.fish index 2790c61e7..6d9a25609 100644 --- a/share/functions/__fish_complete_external_command.fish +++ b/share/functions/__fish_complete_external_command.fish @@ -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 diff --git a/share/functions/__fish_complete_subcommand.fish b/share/functions/__fish_complete_subcommand.fish index bd7cc5009..b622474fa 100644 --- a/share/functions/__fish_complete_subcommand.fish +++ b/share/functions/__fish_complete_subcommand.fish @@ -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