Closed JonathanDoughty closed 4 months ago
I can't reproduce the problem. Any idea why?
$ command -v bash
/opt/homebrew/bin/bash
$ /opt/homebrew/bin/bash --version
GNU bash, version 5.2.26(1)-release (aarch64-apple-darwin21.6.0)
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
$ /opt/homebrew/bin/bash
$ eval "$(fzf --bash)"
$ echo $?
0
This was caused by something earlier in my .bashrc
sequence that had me mystified after I got the same result as you with a minimal .bashrc
:
I had IFS=:
in a PATH setting function defined/used earlier in that sequence that I had neglected to unset or restore to its original value on function exit. Worth insuring that fzf --bash
has the necessary IFS? Only to preclude wastes of time like this. Apologies for the distraction.
No problem, thanks for the clarification.
Worth insuring that fzf --bash has the necessary IFS?
I'm not sure. IFS=:
will likely break other scripts as well, so preventing it here won't help that much and the user will figure it out anyway one way or the other. And from now on, anyone who runs into the same problem will find the answer here.
Checklist
man fzf
)Output of
fzf --version
0.49.0 (brew)
OS
Shell
Problem / Steps to reproduce
with fzf --version: 0.49.0 (brew), and GNU bash, version 5.2.26(1)-release (aarch64-apple-darwin22.6.0) (also via HomeBrew) and
eval "$(fzf --bash)"
in .bashrc I get:on every bash shell startup in Terminal.
It appears this is related to the way arguments are passed to
__fzf_defc
inshell/completion.bash
as quoted strings and then are not expanded as separate arguments as part ofcomplete -F "$func" $opts "$cmd"
I've got a fix I can submit as a PR but since it looks like there has been recent activity in that file perhaps just pasting my patch here would be preferred?