junegunn / fzf

:cherry_blossom: A command-line fuzzy finder
https://junegunn.github.io/fzf/
MIT License
61.91k stars 2.34k forks source link

FZF ignores nested files from $FZF_DEFAULT_COMMAND='fd' but not when piping fd into FZF #3796

Closed 64-bitman closed 3 hours ago

64-bitman commented 1 month ago

Checklist

Output of fzf --version

0.52.0 (bcda25a5)

OS

Shell

Problem / Steps to reproduce

Download this source archive and extract test.tar.gz test.tar.gz.sig.gz

change directory to src/rxvt-unicode-9.31/

export FZF_DEFAULT_COMMAND=fd and run fzf Enter something like xdefaults.c (located in the src/ directory) There should be no matches

run fd | fzf Do the same thing above There should be matches

If you run fd alone it should list the files located in the src/ directory, but FZF for some reason ignores those files when using $FZF_DEFAULT_COMMAND.

The only thing that fixed this is by deleting .gitignore in the top level folder, but I couldn't find anything about FZF handling .gitignore in the man page.

LangLangBart commented 1 month ago

Not reproducible so far.

When you execute fd | grep 'xdefaults.C', do you see the file?

Please share your FZF_DEFAULT_OPTS as well, if set.

64-bitman commented 1 month ago

When you execute fd | grep 'xdefaults.C', do you see the file?

I get:

src/xdefaults.C
src/xdefaults.C.orig

Please share your FZF_DEFAULT_OPTS as well, if set.

FZF_DEFAULT_OPTS: -bind=alt-k:up,alt-j:down,tab:accept,alt-e:abort,ctrl-e:abort,alt-x:cancel,ë:up,ê:down,ø:cancel

Setting it to nothing doesn't do anything either

LangLangBart commented 1 month ago

fzf is essentially an interactive grep tool, with the search performed solely by fd. Since deleting .gitignore in the top-level folder resolved the issue, the command below should also reveal the file.

FZF_DEFAULT_COMMAND="fd --unrestricted" fzf --filter 'xdefaults.C'
# src/xdefaults.C

I assume your .gitignore contains a line to ignore .C files or the entire src/ folder?