-
-
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
:FZF ~ empty in (neo)vim #1061
Comments
How about plain |
That's empty as well. |
Do you have |
I've set |
According to #510 I've now manually set FZF_DEFAULT_COMMAND to
And now it works perfectly. Thanks for the hint! |
Setting
Did you notice the message? |
There was no message, just this:
It still happens when I unset |
That's strange, the following is the default command fzf uses, can you check if it works on your machine? command find -L . -mindepth 1 \( -path '*/\.*' -o -fstype 'sysfs' -o -fstype 'devfs' -o -fstype 'devtmpfs' -o -fstype 'proc' \) -prune -o -type f -print -o -type l -print 2> /dev/null | cut -b3- |
Nope, doesn't work, I assume. It outputs nothing, but returns 0. |
Okay thanks, I see. Looks like Anyway, do you have any idea why that find command doesn't work on your system? |
Yup. When I truncate the command a bit, I get this:
My |
I see, thanks for the investigation. Maybe I could change the default command to retry with simpler command on failure. i.e. |
I'm thinking about changing the default command as follows diff --git a/src/constants.go b/src/constants.go
index cfd3a3b..c3a3dd2 100644
--- a/src/constants.go
+++ b/src/constants.go
@@ -55,7 +55,7 @@ var defaultCommand string
func init() {
if !util.IsWindows() {
- defaultCommand = `command find -L . -mindepth 1 \( -path '*/\.*' -o -fstype 'sysfs' -o -fstype 'devfs' -o -fstype 'devtmpfs' -o -fstype 'proc' \) -prune -o -type f -print -o -type l -print 2> /dev/null | cut -b3-`
+ defaultCommand = `bash -c "set -o pipefail; (command find -L . -mindepth 1 \( -path '*/\.*' -o -fstype 'sysfs' -o -fstype 'devfs' -o -fstype 'devtmpfs' -o -fstype 'proc' \) -prune -o -type f -print -o -type l -print || command find -L . -mindepth 1 -path '*/\.*' -prune -o -type f -print -o -type l -print) 2> /dev/null | cut -b3-"`
} else if os.Getenv("TERM") == "cygwin" {
defaultCommand = `sh -c "command find -L . -mindepth 1 -path '*/\.*' -prune -o -type f -print -o -type l -print 2> /dev/null | cut -b3-"`
} else { |
This works for me. |
- Use bash for `set -o pipefail` - Fall back to simpler find command when the original command failed Related: #1061
In #1061 we changed the default command to retry with a simpler find command with fewer arguments if the first find command failed. This was to support stripped-down verions of find that do not support -fstype argument. However, this caused an unwanted side-effect of yielding duplicate entries when the first command failed after producing some lines. We revert the change in this commit, so the default command will not work with find without -fstype support. But we now print better error message in that case so that the user can set up a working $FZF_DEFAULT_COMMAND. Close #1120 #1167
I ran into this error some hours ago. I'm in Termux also, with oh-my-termux (a ZSH flavour) installed. I see 8eab611 reverts the change to use a simpler find. Is there a default command we should be using here? |
Whenever I try to use :FZF ~ from within vim or neovim, it shows:
The same goes for :Files from the fzf.vim plugin.
Although,
find | fzf
works perfectly. Note that I'm using termux, so shell variables might be unusual, but they're correct:$SHELL
is/data/data/com.termux/files/usr/bin/zsh
,$TERM
isxterm
.The text was updated successfully, but these errors were encountered: