Skip to content

Commit f391bbb

Browse files
committed
fix(xfunc ssh scp_local_files): fix for failglob
1 parent 8a34543 commit f391bbb

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

completions/ssh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -487,12 +487,15 @@ _comp_xfunc_ssh_scp_local_files()
487487
shift
488488
fi
489489

490+
local files
491+
_comp_expand_glob files '"$cur"*'
492+
((${#files[@]})) || return 0
490493
if $dirsonly; then
491-
COMPREPLY+=($(command ls -aF1dL "$cur"* 2>/dev/null |
494+
COMPREPLY+=($(command ls -aF1dL "${files[@]}" 2>/dev/null |
492495
command sed -e "s/$_comp_cmd_scp__path_esc/\\\\&/g" -e '/[^\/]$/d' \
493496
-e "s/^/${1-}/"))
494497
else
495-
COMPREPLY+=($(command ls -aF1dL "$cur"* 2>/dev/null |
498+
COMPREPLY+=($(command ls -aF1dL "${files[@]}" 2>/dev/null |
496499
command sed -e "s/$_comp_cmd_scp__path_esc/\\\\&/g" -e 's/[*@|=]$//g' \
497500
-e 's/[^\/]$/& /g' -e "s/^/${1-}/"))
498501
fi

0 commit comments

Comments
 (0)