Skip to content
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 ignores nested files from $FZF_DEFAULT_COMMAND='fd' but not when piping fd into FZF #3796

Open
5 of 10 tasks
64-bitman opened this issue May 15, 2024 · 3 comments
Open
5 of 10 tasks

Comments

@64-bitman
Copy link

64-bitman commented May 15, 2024

Checklist

  • I have read through the manual page (man fzf)
  • I have searched through the existing issues
  • For bug reports, I have checked if the bug is reproducible in the latest version of fzf

Output of fzf --version

0.52.0 (bcda25a)

OS

  • Linux
  • macOS
  • Windows
  • Etc.

Shell

  • bash
  • zsh
  • fish

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
Copy link
Contributor

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
Copy link
Author

64-bitman commented May 26, 2024

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
Copy link
Contributor

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants