__fish_complete_path: Also use an empty command

This removes a weird `ls` call (that just decorates directories), and
makes it behave like normal path completion.

(really, this should be a proper option to complete)

Fixes #9285
This commit is contained in:
Fabian Boehm 2023-02-14 17:08:25 +01:00
parent 200095998a
commit 4a8ebc0744

View File

@ -10,8 +10,8 @@ function __fish_complete_path --description "Complete using path"
set target "$argv[1]"
set description "$argv[2]"
end
set -l targets "$target"*
set -l targets (complete -C"'' $target")
if set -q targets[1]
printf "%s\t$description\n" (command ls -dp $targets)
printf "%s\n" $targets\t"$description"
end
end