PatrickF1 / fzf.fish

🔍🐟 Fzf plugin for Fish

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

fd --follow

homeisfar opened this issue · comments

commented

Hi, great plugin. I found it easy to use and to modify to my own needs, but I want to ask about one point: What's the rationale for issuing fd --follow? I found fd doesn't really seem to terminate, at least on my system (Fedora Linux), when it follows symlinks. In one case I found that fzf had scanned so many files (which I am not sure if there were redundant entries) that it was consuming 2.1GB RAM on my computer, which is what led me to investigate this in the first place.

Thankfully your code was clean and straightforward, so I modified it and removed --follow, which presents results that does't get stuck searching through what I believe are the two offenders: Steam and Wine.

This is neither here nor there, but I also modified it so ctrl+f does not search for hidden files, and ctrl+g will start a search that will include hidden files. I guess it's possible that might conflict with some terminal emulators (to my knowledge, it doesn't on gnome-terminal) but I think it's a nice trick all the same.

Hi @homeisfar! Thanks for the feedback.
Hmm I didn't ever think --follow would lead to this problem. I was under the assumption that if there's a symlink, the user wants to know what's behind the symlink lest they get a false negative that the file isn't there. It's also more convenient, generally, to be shown more files than you wanted than to not be shown the files you wanted and have to edit the command to re-run. Let me keep thinking about it. I might just remove --follows.

I applied the same principle for why I hardcoded always searching for hidden files.

commented

Sure, if it works for you and others it's fine, I simply wanted to raise awareness to the usage of --follow.

Thanks again for your great plugin!

You're very welcome, Ali. I appreciate your kind words. And thanks for starring it!

Oh btw, an option, at least in the interim, is to configure fd to ignore Steam and Wine. See https://github.com/sharkdp/fd#excluding-specific-files-or-directories

I've decided to turn it off. It seems that more often than not, following symlinks is more trouble than it's worth. I am not sure right now but it seems symlinks often point to massive folders that you wouldn't want to be searching in anyway (anecdotally based on what I'm hearing here and reading at https://www.quora.com/When-do-we-use-symbolic-link-in-Linux and https://www.quora.com/Why-are-symbolic-links-so-commonly-used-in-the-shared-library-of-Linux-usr-lib64).