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

Significant delay when opening the selected file from fzf panel in bash #1064

Closed
4 of 15 tasks
liuchengxu opened this issue Sep 27, 2017 · 13 comments
Closed
4 of 15 tasks

Comments

@liuchengxu
Copy link

  • Category
    • fzf binary
    • fzf-tmux script
    • Key bindings
    • Completion
    • Vim
    • Neovim
    • Etc.
  • OS
    • Linux
    • Mac OS X
    • Windows
    • Windows Subsystem for Linux
    • Etc.
  • Shell
    • 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

@junegunn
Copy link
Owner

junegunn commented Sep 27, 2017

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: BurntSushi/ripgrep#200

@liuchengxu
Copy link
Author

liuchengxu commented Sep 27, 2017

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

@junegunn
Copy link
Owner

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.

@dpnova
Copy link

dpnova commented Nov 1, 2017

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

@junegunn
Copy link
Owner

junegunn commented Nov 2, 2017

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.

a6d2ab3

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

@dpnova
Copy link

dpnova commented Nov 6, 2017

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.

@dpnova
Copy link

dpnova commented Nov 6, 2017

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

@junegunn
Copy link
Owner

junegunn commented Nov 6, 2017

@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

@dpnova
Copy link

dpnova commented Nov 6, 2017

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

@dpnova
Copy link

dpnova commented Nov 13, 2017

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?

@junegunn
Copy link
Owner

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

@dpnova
Copy link

dpnova commented Nov 14, 2017

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!

@yxchng
Copy link

yxchng commented Nov 27, 2019

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

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

4 participants