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()
25082508 backslash=\\
25092509 fi
25102510
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+
25112518 local -a dirs=()
25122519
25132520 # Lookup order:
@@ -2531,9 +2538,8 @@ __load_completion()
25312538 dirs+=(./completions)
25322539 fi
25332540
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=()
25372543 _comp_split -aF : paths " $PATH "
25382544 for dir in " ${paths[@]%/ } " ; do
25392545 if [[ -d $dir && $dir == ?*/@(bin|sbin) ]]; then
You can’t perform that action at this time.
0 commit comments