mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-25 18:03:37 +08:00
308e0ceb9d
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
(cherry picked from commit 4a8ebc0744
)
18 lines
444 B
Fish
18 lines
444 B
Fish
function __fish_complete_path --description "Complete using path"
|
|
set -l target
|
|
set -l description
|
|
switch (count $argv)
|
|
case 0
|
|
# pass
|
|
case 1
|
|
set target "$argv[1]"
|
|
case 2 "*"
|
|
set target "$argv[1]"
|
|
set description "$argv[2]"
|
|
end
|
|
set -l targets (complete -C"'' $target")
|
|
if set -q targets[1]
|
|
printf "%s\n" $targets\t"$description"
|
|
end
|
|
end
|