lincheney / fzf-tab-completion

Tab completion using fzf
GNU General Public License v3.0
632 stars 40 forks source link

Bash completion actually requires GNU Awk #28

Closed tseeker closed 3 years ago

tseeker commented 3 years ago

Description

Trying to use the bash completion code with mawk installed (instead of gawk) doesn't work. The completions are listed but it is impossible to select them.

The problem is caused by the fact that fzf-bash-completion.sh line 254 doesn't do what it should when mawk is in use, leaving the input untouched.

Environment

zcaudate commented 3 years ago

I replaced sed to gsed and awk to gawk in order to get it working

https://github.com/lincheney/fzf-tab-completion/compare/master...zcaudate:master

I'm not great with bash script can these commands be parameterized depending on the os?

lincheney commented 3 years ago

looks like mawk does not support .{n} style regexes, I've converted it to use substr() which is probably better anyway https://github.com/lincheney/fzf-tab-completion/commit/516c4c1925e504edb3519b699f15eb6acd5c9054 Can you try with this and see if it resolves your issue?