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 plugin sometimes not responding to typing #927

Closed
4 tasks done
bsander opened this issue Jan 8, 2020 · 14 comments
Closed
4 tasks done

FZF plugin sometimes not responding to typing #927

bsander opened this issue Jan 8, 2020 · 14 comments

Comments

@bsander
Copy link

bsander commented Jan 8, 2020

Sometimes after opening FZF with the Files or Rg command, fzf is not responding to anything I type. Pressing Escape generates a keycode instead, and I have to C-c to exit the buffer. Retrying the same command immediately after usually results in FZF functioning perfectly fine. But apart from that, this issue appears to happen quite randomly.

Don't know what other relevant info I can provide at this stage, please let me know 🙂

Screenshot 2020-01-07 at 15 09 11

@junegunn
Copy link
Owner

junegunn commented Jan 9, 2020

I haven't had the issue. Is it reproducible with the minimal config shown in the issue template?

@daogilvie
Copy link

daogilvie commented Jan 21, 2020

Hi @junegunn; thanks for maintaining fzf and this plugin, I'm really enjoying using them both!
That said, unfortunately I am experiencing the same issue as bsander, but it is not random — it happens to me in pretty much every invocation of Rg and Ag, but not of Files.

This does happen with the minimal config. I am on Catalina 10.15.2, using NVIM v0.4.3. There are no error messages in :messages, and I can't see anything that looks obvious when I run with -V9 logging (but I don't really know what I would be looking for).

Please let me know how I can help narrow this down.

Addendum

2 things:

  1. If I type some characters and press enter, the results are reloaded with matches, but my cursor also moves down a row and I can no longer delete the characters I just typed no matter how hard I try.
  2. It seems to be happening when it completes enumerating the files for the initial search. I tried all of the variations of the Rg command you suggest in the documentation, including https://github.com/junegunn/fzf.vim#example-advanced-ripgrep-integration, but nothing has made any difference.
    It doesn't matter if I call Rg with or without arguments — once the initial list of results is complete. If I do the command on big folder trees, though, I am indeed able to use keyboard inputs as expected whilst it is still collecting results together.

Addendum 2

Seems to be working fine after restarting laptop a couple of times and downloading latest update via plug (thank you for that also) as of 15 minutes ago. Will update this issue if I see it again.

@daogilvie
Copy link

It keeps recurring. If you think of any useful information for debugging, let me know.

@xp-bar
Copy link

xp-bar commented Jan 23, 2020

I've been having this problem for a while - haven't been able to find any information out there on it - this is actually the first issue I've found.

My setup is basically:

nvim install info

NVIM v0.4.2
Build type: Release
LuaJIT 2.0.5
Compilation: /usr/local/Homebrew/Library/Homebrew/shims/mac/super/clang -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNDEBUG -DMIN_LOG_LEVEL=3 -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -I/tmp/neovim-20190916-88369-176iaxs/neovim-0.4.2/build/config -I/tmp/neovim-20190916-88369-176iaxs/neovim-0.4.2/src -I/usr/local/include -I/tmp/neovim-20190916-88369-176iaxs/neovim-0.4.2/deps-build/include -I/usr/local/opt/gettext/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include -I/tmp/neovim-20190916-88369-176iaxs/neovim-0.4.2/build/src/nvim/auto -I/tmp/neovim-20190916-88369-176iaxs/neovim-0.4.2/build/include
Compiled by brew@Mojave-2.local

Features: +acl +iconv +tui
See ":help feature-compile"

system vimrc file: "$VIM/sysinit.vim"
fall-back for $VIM: "/usr/local/Cellar/neovim/0.4.2/share/nvim"

Run :checkhealth for more info

it seems all the fzf.vim commands randomly stop accepting input - even though the command is clearly running / not frozen (the file number is ticking up, neovim itself isn't frozen). The cli command will also sometimes hang in the same manner - but no prompt appears (vs. in nvim, where the files list shows up fine, but it doesn't accept any input)

When using tmux, I have noticed is that closing out that (tmux) window completely seems to solve the issue - but opening and closing neovim within the same (tmux) window / split doesn't seem to resolve the issue.

@heliostatic
Copy link

I have the same setup as you @xp-bar -- tmux definitely exacerbates the issue, as I have a 100% repro with rg / fzf#vim#grep in tmux.

@heliostatic
Copy link

heliostatic commented Jan 29, 2020

@junegunn I have a consistent repro with the minimal vimrc:
asciicast

Edit: Better recording

@heliostatic
Copy link

Update: I was too impatient -- the file actually does open after ~40 seconds.
asciicast

@heliostatic
Copy link

Last update I think:
No repro under iTerm. Just Alacritty + Tmux for me. I'll file a bug in the Alacritty repo.

@heliostatic
Copy link

Hmm, I can now repro under Terminal.app and iTerm, no tmux session.

Here's a debug log showing the issue: debug.txt

I used the minimal .vimrc but added verbose logging level 12:

set nocompatible hidden laststatus=2

set verbose=12
set verbosefile=debug.txt

if !filereadable('/tmp/plug.vim')
  silent !curl --insecure -fLo /tmp/plug.vim
    \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
endif

source /tmp/plug.vim
call plug#begin('/tmp/plugged')
Plug 'junegunn/fzf', { 'do': './install --bin' }
Plug 'junegunn/fzf.vim'
call plug#end()

autocmd VimEnter * PlugClean! | PlugUpdate --sync

@sethfowler
Copy link

It's unsurprising, since it's based on neovim, but FWIW I experience this issue frequently with VimR v0.31.0-337 as well.

@daogilvie
Copy link

daogilvie commented Feb 3, 2020

Update

I have found that leaving the Rg results buffer open for 30s then closing with Ctrl-C does then make it work as expected (i.e responds to input as expected). It also then works straight away in new Vim sessions and terminals after doing this. I will try to have a look in some more detailed logs and see what might be happening. At a loss. I will unsubscribe from this issue as I'm no longer being affected by it without a workaround.

@xp-bar
Copy link

xp-bar commented Feb 4, 2020

^ I still have this issue occasionally (about once a day, closing tmux window resolves it), so I'll do what I can to post any relevant info here

Speaking of relevant info, I have no idea where to start - haven't ever debugged anything like this before. Any specific log files I should be watching / submitting?

junegunn added a commit to junegunn/fzf that referenced this issue Feb 13, 2020
Revert the change introduced in #552. It seems that the startup time
difference between bash and fish is not much of an issue now.

  > time bash -c 'date'
  Thu Feb 13 21:15:03 KST 2020

  real    0m0.008s
  user    0m0.003s
  sys     0m0.003s

  > time fish -c 'date'
  Thu Feb 13 21:15:05 KST 2020

  real    0m0.014s
  user    0m0.007s
  sys     0m0.006s

When we explicitly *pipe* $FZF_DEFAULT_COMMAND instead of making fzf
internally start the process ($FZF_DEFAULT_COMMAND | fzf), fzf may hang
if the input process doesn't quickly process SIGPIPE and abort.

Also, fzf#vim#grep temporarily swaps $FZF_DEFAULT_COMMAND instead of
setting 'sink' so fzf can kill the default command on 'reload'.

junegunn/fzf.vim#927

However, because of the "pipe conversion", the trick wasn't working as
expected.

https://github.com/junegunn/fzf.vim/blob/467c3277884240f7b5430f8f4d600e3415c38f3b/autoload/fzf/vim.vim#L720-L726

We can go even further and always set $FZF_DEFAULT_COMMAND instead of
piping source command.
@junegunn
Copy link
Owner

Hi, please test if junegunn/fzf@5e1db9f fixes the issue.

@heliostatic
Copy link

Hi, please test if junegunn/fzf@5e1db9f fixes the issue.

Just installed from master and it appears the issue is resolved by junegunn/fzf@5e1db9f

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

6 participants