Closed ziranjameshe closed 4 months ago
Hello What version of bash do you have installed
Hey, tried both bash 3.2.57
and 4.4.20
. Problem exist on both.
Same issue here. Using macOS Sonoma v14.2 GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin23)
ggrep (GNU grep) 3.11 gsed (GNU sed) 4.9 GNU Awk 5.3.0, API 4.0, PMA Avon 8-g1, (GNU MPFR 4.2.1, GNU MP 6.3.0)
I can reproduce this issue on bash 3 only and not bash 4. For bash 3, can you please upgrade to a more recent version of bash
Thanks for the quick turnaround.
I am pretty sure I have tried installing the bash 4+, but seeing the same issue.
Can we not just fix the problem?
Hi
I've tried on both bash 4.4 and 4.3 and unable to reproduce this issue. Are you able to try installing a more recent version of bash (e.g. bash 5)? Unfortunately I have limited appetite for making this work on older versions of bash that I do not run (especially bash 3!). However, if you would like to try getting it working on older versions yourself and open PR for any changes, that would also be appreciated.
Hey, just tried bash 5. I can source in the script now. Do you not get a tac: command not found error
?
I think tac
only available on linux.
Hey, just tried bash 5. I can source in the script now. Do you not get a
tac: command not found error
?I think
tac
only available on linux.
Actually, I can resolve this by installing brew install coreutils
. But there is some strange behaviour with sed now.
I am seeing sed: First RE may not be empty
with a cd <TAB>
showing all the available bash command
+1 to the sed: First RE may not be empty
on macOS with GNU bash, version 5.2.21(1)-release (x86_64-apple-darwin23.0.0)
and showing a listing of all possible bash commands.
if you can pinpoint which sed
in the script is failing, that would be helpful
If you do set -x
and then try it, it should print out the commands it runs, and then you may be able to find which sed
command is problematic
set -x
gives the following traceback: +++ printf '%s\n' ' ' +++ buffer= +++ IFS= +++ read -r line +++ case "$line" in +++ (( count < 0 )) +++ (( count > 0 )) +++ printf '%s\n' git +++ buffer= +++ IFS= +++ read -r line +++ printf '%s\n' '' sed: first RE may not be empty ++ [[ 0 -gt 1 ]] +++ printf %s ++ COMP_LINE= ++ COMP_POINT=0 ++ readarray -t COMP_WORDS +++ printf '%s\n' +++ ggrep '[^[:space:]]' ++ [[ 0 = 0 ]] ++ COMP_WORDS+=('') ++ COMP_CWORD=1 ++ (( COMP_CWORD-- )
pointing at
_fzf_bash_completion_parse_line which fails at the sed pipe here:
| _fzf_bash_completion_flatten_subshells \
| tr \\n \\0 \
| "$_fzf_bash_completion_sed" -r "$(cat <<'EOF'
i think this may be due to the null bytes, mac sed probably can't handle it, i 'll see if i can change it to something else
I have pushed this https://github.com/lincheney/fzf-tab-completion/commit/9616591b74c72c0f716b214c659b2c3c91964e75, hoping it may fix some of the issues.
I have pushed this 9616591, hoping it may fix some of the issues.
Thanks for looking. It does address the above issue but this doesn't seem to fix the not working issue on MacOS.
The behaviour now is TAB
won't return any match