lincheney / fzf-tab-completion

Tab completion using fzf
GNU General Public License v3.0
652 stars 41 forks source link

bash: improve compatibility to bash v4.2 and before #105

Closed henry-hsieh closed 5 months ago

henry-hsieh commented 5 months ago

Bash v4.2 and before didn't support negative subscripts. This commit changes the index selection to array[len(array)-1] to fix the errors before Bash v4.2:

bash: COMP_WORDS[-1]: bad array subscript