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 blocks Vim while opened in tmux pane #775

Closed
3 of 15 tasks
kodemeister opened this issue Dec 17, 2016 · 2 comments
Closed
3 of 15 tasks

FZF blocks Vim while opened in tmux pane #775

kodemeister opened this issue Dec 17, 2016 · 2 comments

Comments

@kodemeister
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

Steps to reproduce:

  1. Run Vim inside tmux
  2. Run FZF
  3. Switch back to Vim pane
  4. Type any characters

Expected: Vim consumes typed characters as usual
Observed: Vim is blocked and typed characters are echoed on the screen until FZF is closed

fzf

This issue per se is not so important but it causes another bugs: #434, tmux-plugins/vim-tmux-focus-events#2. With set -g focus-events on tmux sends FocusIn/FocusOut escape sequences (<Esc>[I and <Esc>[O) to Vim instance. But since Vim is blocked by FZF, these escape sequences are echoed on the screen as ^[[I and ^[[O.

By default, Neovim doesn't have such issues because FZF is running asynchronously in separate terminal. But in Vim FZF is invoked with blocking system() call.

https://github.com/junegunn/fzf/blob/master/plugin/fzf.vim#L395

Would it be possible to have the same asynchronous FZF behavior in Vim as well, e.g. by using Vim 8 job API?

@junegunn
Copy link
Owner

I'm not sure if I want to rewrite Vim plugin to work in asynchronous manner, as it complicates the implementation without obvious benefit (and also because I don't use the tmux plugin). Have you tried the workaround suggested in tmux-plugins/vim-tmux-focus-events#2 (comment)?

@kodemeister
Copy link
Author

Yes, I've tried this workaround but unfortunately it doesn't work for me. Once I open FZF, leftover characters begin to appear.

Another affected plugin is https://github.com/christoomey/vim-tmux-navigator. Again, navigation works fine until I open FZF. While it's opened, I can't switch from Vim to other panes using vim-tmux-navigator because Vim is blocked.

I could give async FZF invocation a try using Neovim implementation as an example. At first glance, it doesn't seem to be so hard. Can you please point me out any clues/caveats here?

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

2 participants