On Tue, Jan 19, 2021 at 10:22:35AM +0100, Rens Houben wrote:
> Since an update to /some/ part of vim on unstable sometime last weekend I've 
> encountered new default behaviour that's quite disruptive.
> 
> For instance, when I started writing this, as well as every single time this
> terminal window gains or loses focus, vim fires a console beep and gives a
> popup of the following two lines:
> 
> ---
> /tmp/reportbug-vim-20210119-44233-2mw9ao7j
>   1:    1 Subject: vim: Change in default vim config causes obnoxious 
> behaviour.
> ---

It sounds like this is some interaction with the recent change to allow
Vim to receive events from the terminal when focus is gained/lost.  This
is described in ":help xterm-focus-event".

The terminal sends <Esc>[I when focus comes back, which is what makes
you leave insert mode (<Esc>) and show that popup ([I).

If this were working correctly, you wouldn't have noticed a difference
(as is the case in xterm), but there's something going on with the other
terminals.

Can you provide the package names and versions for the terminals that
aren't working right?

Also, it would help if you ran the below command in each terminal
(replacing <term> with the terminal name) and attached the resulting log
for each.

vim --cmd 'au FocusGained * call ch_log("f_in")' --cmd 'au FocusLost * call 
ch_log("f_out")' --cmd 'call ch_logfile("focus_<term>.log", "a")'

In each terminal, once Vim starts please switch to another application,
back to the terminal, and then exit Vim.  That will capture the terminal
codes that Vim sends and the responses from the terminal so we can try
and figure out where things are going wrong.

>    I expected vim to keep working as it has for several decades and default
> to /not/ cause this new behaviour, or at least properly document the change
> so I'd have an idea what feature to turn off.

You can add the below snippet to your vimrc to disable this
functionality:

    if exists('+t_fd')
      set t_fd=
      set t_fe=
    endif

Cheers,
-- 
James
GPG Key: 4096R/91BF BF4D 6956 BD5D F7B7  2D23 DFE6 91AE 331B A3DB

Reply via email to