-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reload command does not use the SHELL #3355
Comments
fzf --bind 'ctrl-r:reload:eval $FZF_DEFAULT_COMMAND'
man fzf
# FZF_DEFAULT_COMMAND
# Default command to use when input is tty. On *nix systems, fzf runs the command
# with $SHELL -c if SHELL is set, otherwise with sh -c, so in this case make sure
# that the command is POSIX-compliant. |
fzf does use $SHELL.
You'll get the same result if you do the same on bash bash
$ export FZF_DEFAULT_COMMAND='echo "test"'
$ $FZF_DEFAULT_COMMAND
"test" So, use eval as suggested by @LangLangBart $ eval "$FZF_DEFAULT_COMMAND"
test |
Thank you. Yes, you are right. I quickly run fzf with strace and didn't spot the bash -c call somehow (probably because I was looking for the wrong thing). The confusion (and different behavior) just comes from the fact that when setting The example from #1750 makes it look like those two things should be identical:
It would help to call this out more explicitly. That one needs to evaluate the variable manually, either by using |
man fzf
)0.42.0 (d471067)
)Info
Problem / Steps to reproduce
From reading the man page and looking at #1750 I got the idea that one could use
FZF_DEFAULT_COMMAND
in the reload action, but that does not work like advertised:When run, this displays
test
in the result list. When hitting ctrl-r it displays"test"
(including the quotes).So in order to use the
FZF_DEFAULT_COMMAND
in reload you would have to pass it to the SHELL explicitly:The text was updated successfully, but these errors were encountered: