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 19ff475 commit 8c136edCopy full SHA for 8c136ed
bash_completion
@@ -1367,8 +1367,11 @@ _comp_finalize()
1367
fi
1368
1369
1370
- unset -v '_comp_finalize__depth[-1]'
1371
- 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
1372
+ # element. It is supported in bash 4.3.
1373
+ unset -v '_comp_finalize__depth[${#_comp_finalize__depth[@]}-1]'
1374
+ unset -v '_comp_finalize__target[${#_comp_finalize__target[@]}-1]'
1375
if ((${#_comp_finalize__depth[@]} == 0)); then
1376
eval -- "${_comp_finalize__original_return_trap:-trap - RETURN}"
1377
_comp_finalize__original_return_trap=
0 commit comments