Skip to content

Commit 61982cb

Browse files
akinomyogascop
andcommitted
fix(__load_completion): search completions in share/ from real path
Co-authored-by: Ville Skyttä <[email protected]>
1 parent e4ede51 commit 61982cb

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

bash_completion

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2548,8 +2548,12 @@ __load_completion()
25482548
dirs+=(./completions)
25492549
fi
25502550
2551-
# 3) From bin directories extracted from path to command, and $PATH
2552-
[[ $cmd == */* ]] && paths=("${cmd%/*}") || paths=()
2551+
# 3) From bin directories extracted from the specified path to the command,
2552+
# the real path to the command, and $PATH
2553+
paths=()
2554+
[[ $cmd == */* ]] && paths+=("${cmd%/*}")
2555+
local ret
2556+
_comp_realcommand "$cmd" && paths+=("${ret%/*}")
25532557
_comp_split -aF : paths "$PATH"
25542558
for dir in "${paths[@]%/}"; do
25552559
[[ $dir == ?*/@(bin|sbin) ]] &&

0 commit comments

Comments
 (0)