File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -2508,6 +2508,13 @@ __load_completion()
2508
2508
backslash=\\
2509
2509
fi
2510
2510
2511
+ # Try to resolve real path to $cmd , and make it absolute
2512
+ local ret realcmd=
2513
+ if _comp_realcommand " $cmd " ; then
2514
+ realcmd=$ret
2515
+ cmd=${realcmd%/* } /$cmdname # basename could be an alias
2516
+ fi
2517
+
2511
2518
local -a dirs=()
2512
2519
2513
2520
# Lookup order:
@@ -2531,9 +2538,8 @@ __load_completion()
2531
2538
dirs+=(./completions)
2532
2539
fi
2533
2540
2534
- # 3) From bin directories extracted from $( realpath " $cmdname " ) and PATH
2535
- local ret
2536
- _comp_realcommand " $cmd " && paths=(" ${ret%/* } " ) || paths=()
2541
+ # 3) From bin directories extracted from path to command, and $PATH
2542
+ [[ $realcmd ]] && paths=(" ${realcmd%/* } " ) || paths=()
2537
2543
_comp_split -aF : paths " $PATH "
2538
2544
for dir in " ${paths[@]%/ } " ; do
2539
2545
if [[ -d $dir && $dir == ?*/@(bin|sbin) ]]; then
You can’t perform that action at this time.
0 commit comments