fzf icon indicating copy to clipboard operation
fzf copied to clipboard

FZF not listing files in storage directory in termux $HOME

Open abdulramonjemil opened this issue 3 years ago • 5 comments

  • [ ] I have read through the manual page (man fzf)
  • [x] I have the latest version of fzf
  • [x] I have searched through the existing issues

Info

  • OS
    • [x] Linux
    • [ ] Mac OS X
    • [ ] Windows
    • [ ] Etc.
  • Shell
    • [x] bash
    • [ ] zsh
    • [ ] fish

Problem

I am configuring vim in termux and I have decided use FZF to implement the fuzzy finding feature. I installed fzf using pkg install fzf and mapped Ctrl + P to open FZF dialogue. Everything works well. But when I'm in the home directory and I invoke FZF from there (inside vim using :FZF), I don't get results from the storage subdirectory, which I don't expect. I used termux-setup-storage to setup access to my phone's internal storage. This might be the same in some other directories, but the $HOME directory is the one I've noticed. See image below: shot_2021-11-26_16-58-34

When I use FZF in the home directory from the command line, everything works well. For example, I typed cd ** followed by tab and I get something like this: shot_2021-11-26_17-22-43

Please, what do you think is the problem. I'm not using the FZF vim plugin at all. Also, I changed the default command (to use fd instead of find).

abdulramonjemil avatar Nov 26 '21 16:11 abdulramonjemil

Hi, this is the find command fzf uses by default: https://github.com/junegunn/fzf/blob/764316a53d0eb60b315f0bbcd513de58ed57a876/src/constants.go#L60-L61

Can you spot any issue with that? If you run the command manually, does it list the storage dir?

vovcacik avatar Nov 28 '21 14:11 vovcacik

I've just run the command and it does list files in the storage dir as shown in the image below. shot_2021-11-28_18-18-27 But there's a problem. I already changed this to another command (fd). See the image below. It shows the content of my .bashrc after running cat on it. shot_2021-11-28_18-19-00

In addition to that, I already tried changing it to use find again but it doesn't seem to work in vim. It says fd command failed even after changing the default command to use find and sourcing the .bashrc.

ghost avatar Nov 28 '21 17:11 ghost

I've just changed the command in my .bashrc to the default command, but it doesn't seem to work anymore. shot_2021-11-28_18-34-23

ghost avatar Nov 28 '21 17:11 ghost

But it works on the command line

ghost avatar Nov 28 '21 19:11 ghost

@vovcacik Kindly help me see to this. Do you know why the command would work from the command line but not from within vim.

ghost avatar Nov 29 '21 15:11 ghost