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 6c9536b commit 6d0830fCopy full SHA for 6d0830f
bash_completion
@@ -1517,8 +1517,11 @@ _comp_finalize()
1517
fi
1518
1519
1520
- unset -v '_comp_finalize__depth[-1]'
1521
- 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
1522
+ # element. It is supported in bash 4.3.
1523
+ unset -v '_comp_finalize__depth[${#_comp_finalize__depth[@]}-1]'
1524
+ unset -v '_comp_finalize__target[${#_comp_finalize__target[@]}-1]'
1525
if ((${#_comp_finalize__depth[@]} == 0)); then
1526
eval -- "${_comp_finalize__original_return_trap:-trap - RETURN}"
1527
_comp_finalize__original_return_trap=
0 commit comments