Fzf: Significant delay when opening the selected file from fzf panel in bash

Created on 27 Sep 2017  路  13Comments  路  Source: junegunn/fzf

  • Category

    • [ ] fzf binary

    • [ ] fzf-tmux script

    • [ ] Key bindings

    • [ ] Completion

    • [x] Vim

    • [x] Neovim

    • [ ] Etc.

  • OS

    • [ ] Linux

    • [x] Mac OS X

    • [ ] Windows

    • [ ] Windows Subsystem for Linux

    • [ ] Etc.

  • Shell

    • [x] bash

    • [ ] zsh

    • [ ] fish

When I want to open a file using :FZF ~, given the file selected and enter key pressed, it will cost more than ten seconds to open the selected one. What's more, the delay also comes with <Ctrl-c> to close fzf in vim.

The problem only occurs in bash. In zsh, everything goes well. Any tips to figure it out? Thanks.

fzf

Most helpful comment

They seem to have fixed the issue for *nix systems, but an official release with the fix has not been released yet. I'll check if they have any plans for a new version.

All 13 comments

Do you use rg as your FZF_DEFAULT_COMMAND? I experienced similar issues when using rg --files as my default command. And that's why I'm still suggesting ag on the readme page when rg has a better implementation of gitignore filtering.

time rg --files | head -1

time ag -g "" | head -1

Related: https://github.com/BurntSushi/ripgrep/issues/200

Yes, I do use rg as my FZF_DEFAULT_COMMAND and have solved it based on your suggestion. Big thanks to your quick response!

They seem to have fixed the issue for *nix systems, but an official release with the fix has not been released yet. I'll check if they have any plans for a new version.

I'm seeing this problem or something similar in vim. Except sometimes it never closes... should I open a new issue?

screenshot from 2017-11-02 07-51-46

I'm pretty sure that it's not an issue of fzf or fzf.vim. Does :!which rg point to the right binary?

Anyway, rg still shows some delay in some cases and I now use fd instead which is better suited for this use case.

https://github.com/junegunn/fzf/commit/a6d2ab33609ad20ce107e66d9648d908800fa3ad

jg@jg-mbp:~> time rg --files | head -1
out

real    0m1.601s
user    0m1.298s
sys     0m3.737s
jg@jg-mbp:~> time fd --type f | head -1
out

real    0m0.116s
user    0m0.174s
sys     0m0.162s

I'm actually getting the same behaviour with fd in neovim.

I'm using:

禄 env | grep FZF
FZF_DEFAULT_COMMAND=fd --type f

screenshot from 2017-11-06 10-34-45

It wasn't an issue before I formatted this machine... not sure what versions of things I was running before though. The only major thing I can think of is now I'm using the neovim appimage instead of their ubuntu repos as I was before.

I should note the delay is only on the first invocation, if it ever finishes the next one is lightning fast.

@dpnova See if you can still reproduce the problem with the minimal configuration as suggested here.

https://raw.githubusercontent.com/junegunn/fzf.vim/master/.github/ISSUE_TEMPLATE.md

This screenshot is the same behaviour happening with the minimal command (using :FZF)

This is ubuntu 17.10 with nvim appimage.

Let me know if there's something else I can try! Thanks heaps.

screenshot from 2017-11-06 12-03-45

I've noticed that sometimes the panel goes away if I select anotoher window/term and then go back to this one... could it be related to waiting for something? I've recently moved back to gnome terminal/tilix from urxvt .. could it be related?

No idea, do you have the same issue on regular Vim?

My simple testing with vim seems to indicate it's isolated to nvim. I could open a bug over there.. I'm not quite sure what I would report as the issue though. I'll link back here. Thanks!

@liuchengxu @junegunn I am using Ag and I am facing the significant delay problem? How to solve it?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sassanh picture sassanh  路  3Comments

olethanh picture olethanh  路  3Comments

asilvadesigns picture asilvadesigns  路  3Comments

firedev picture firedev  路  3Comments

leonklingele picture leonklingele  路  3Comments