Fzf: FZF not closing with <Esc>+<Another Key>

Created on 27 Sep 2018  路  6Comments  路  Source: junegunn/fzf

  • Category

    • [X] fzf binary

    • [ ] fzf-tmux script

    • [X] Key bindings

    • [ ] Completion

    • [ ] Vim

    • [X] Neovim

    • [ ] Etc.

  • OS

    • [X] Linux

    • [ ] Mac OS X

    • [ ] Windows

    • [ ] Windows Subsystem for Linux

    • [ ] Etc.

  • Shell

    • [ ] bash

    • [X] zsh

    • [ ] fish


TL;DR fzf does not close window when <Esc>+<Another Key> is pressed.

I mainly use fzf in neovim and I have noted that sometimes the closing of it locks up strangely. Today I did some investigating to why and I quickly noted that I sometimes double tap <Esc>. fzf seems to set <Esc> as some kind of leader key as keys pressed quickly after <Esc> puts it into some kind of state.

The expected behavior would be that <Esc> would exit fzf cleanly and straight-away just like <C-c> does.

bug

Most helpful comment

Reducing ESC delay can make fzf unable to read keys with ALT modifier on some terminals. Since you use Neovim, consider setting up a terminal mapping for fzf buffer.

autocmd! FileType fzf tnoremap <buffer> <esc> <c-c>

All 6 comments

Escape character indeed works as alt modifier on terminal. i.e. escape + a is alt-a. However, fzf clearly isn't properly handling double escape characters and unnecessarily waits for more key strokes. I'll fix this.

Fixed pushed to master. Let me know if you still see the issue.

@junegunn Works now, made a huge workflow improvement for me - so thank you! :hugs:

Just a side-note, it it possible for fzf to take a config option that disables <Esc> as a modifier? I'm seeing a slight delay in closing the window compared to <C-c>. I'm really nitpicking now but it would be nice if it was possible.

Reducing ESC delay can make fzf unable to read keys with ALT modifier on some terminals. Since you use Neovim, consider setting up a terminal mapping for fzf buffer.

autocmd! FileType fzf tnoremap <buffer> <esc> <c-c>

@junegunn Ahhh :yum:, that did the trick! Yet again thank you - and thank you for creating such a indispensable tool.

Using the code above autocmd! FileType fzf tnoremap <buffer> <esc> <c-c> disabled me to use <shift> + <tab> for selecting multiple results. I have found another workaround that works also in this case:

set ttimeoutlen=0
Was this page helpful?
0 / 5 - 0 ratings

Related issues

alistaircolling picture alistaircolling  路  3Comments

asilvadesigns picture asilvadesigns  路  3Comments

chrisamow picture chrisamow  路  3Comments

natemara picture natemara  路  3Comments

jan-warchol picture jan-warchol  路  3Comments