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 ac2112d commit 40235a3Copy full SHA for 40235a3
bash_completion
@@ -1000,8 +1000,11 @@ _comp_finalize()
1000
fi
1001
1002
1003
- unset -v '_comp_finalize__depth[-1]'
1004
- 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
1005
+ # element. It is supported in bash 4.3.
1006
+ unset -v '_comp_finalize__depth[${#_comp_finalize__depth[@]}-1]'
1007
+ unset -v '_comp_finalize__target[${#_comp_finalize__target[@]}-1]'
1008
if ((${#_comp_finalize__depth[@]} == 0)); then
1009
eval -- "${_comp_finalize__original_return_trap:-trap - RETURN}"
1010
_comp_finalize__original_return_trap=
0 commit comments