jcanseco/.dotfiles

'<F24><F25>' is inserted when vim loses and regains focus while in paste mode

Opened this issue · 0 comments

Reproduction Steps

  1. Open vim in tmux
  2. :set paste
  3. Enter insert mode
  4. Make vim lose focus (e.g. by switching to another window)
  5. Go back to vim

Note that <F24><F25> has been inserted onto vim.

Findings

The issue seems to be caused by the vim-tmux-focus-events plugin.

The plugin sets <F24> and <F25> equal to <Esc>[O and <Esc>[I, respectively (source). This is the main way by which the plugin intercepts signals from tmux when vim loses and gains focus. The plugin then handles the signals by defining mappings for <F24> and <F25>.

The problem is that all mappings are disabled in paste mode, so <F24> and <F25> ends up being inserted with nothing to handle them.