From f1478137dc706a9fc16b73126e260b340e6d3c0b Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Sat, 12 Dec 2020 08:22:45 +0100 Subject: [PATCH] __fish_complete_path: guard against non-matching input --- share/functions/__fish_complete_path.fish | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/share/functions/__fish_complete_path.fish b/share/functions/__fish_complete_path.fish index 614d914a8..03a13fd3e 100644 --- a/share/functions/__fish_complete_path.fish +++ b/share/functions/__fish_complete_path.fish @@ -10,5 +10,8 @@ function __fish_complete_path --description "Complete using path" set target "$argv[1]" set description "$argv[2]" end - printf "%s\t$description\n" (command ls -dp "$target"*) + set -l targets "$target"* + if set -q targets[1] + printf "%s\t$description\n" (command ls -dp $targets) + end end