We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 17c1fab commit 503cf7bCopy full SHA for 503cf7b
bash_completion
@@ -679,9 +679,12 @@ _variables()
679
return 0
680
elif [[ $cur =~ ^(\$\{[#!]?)([A-Za-z0-9_]*)\[([^]]*)$ ]]; then
681
# Complete ${array[i with ${array[idx]}
682
- local IFS=$'\n'
+ local reset=$(shopt -po noglob) IFS=$'\n'
683
+ set -o noglob
684
COMPREPLY+=($(compgen -W '$(printf %s\\n "${!'${BASH_REMATCH[2]}'[@]}")' \
685
-P "${BASH_REMATCH[1]}${BASH_REMATCH[2]}[" -S ']}' -- "${BASH_REMATCH[3]}"))
686
+ IFS=$' \t\n'
687
+ $reset
688
# Complete ${arr[@ and ${arr[*
689
if [[ ${BASH_REMATCH[3]} == [@*] ]]; then
690
COMPREPLY+=("${BASH_REMATCH[1]}${BASH_REMATCH[2]}[${BASH_REMATCH[3]}]}")
0 commit comments