We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ec17753 commit b6a67f6Copy full SHA for b6a67f6
bash_completion
@@ -1006,8 +1006,11 @@ _comp_finalize()
1006
fi
1007
1008
1009
- unset -v '_comp_finalize__depth[-1]'
1010
- unset -v '_comp_finalize__target[-1]'
+ # Note: bash 4.2 does not support negative array indices with `unset`
+ # like `unset -v 'arr[-1]'` even when the array has at least one
1011
+ # element. It is supported in bash 4.3.
1012
+ unset -v '_comp_finalize__depth[${#_comp_finalize__depth[@]}-1]'
1013
+ unset -v '_comp_finalize__target[${#_comp_finalize__target[@]}-1]'
1014
if ((${#_comp_finalize__depth[@]} == 0)); then
1015
eval -- "${_comp_finalize__original_return_trap:-trap - RETURN}"
1016
_comp_finalize__original_return_trap=
0 commit comments