Control: clone -1 -2
Control: reassign -2 vim
Control: retitle -2 vim: bracketed paste is broken before patch 9.0.1117

Notice to the vim maintainers: #1027435 has a few more messages you
might want to read for background.

On 2022-12-31 14:18 +0100, Antoine Le Gonidec wrote:

> Package: ncurses-base
> Version: 6.3+20221224-2
> Severity: important
>
> Since the 6.3+20221224-2 update, vim pasting behaviour is broken when
> TERM is set to "tmux" or "tmux-256color".
>
> To reproduce it, open vim, type a few word, then try to copy/paste them
> using selection then middle mouse clic, or Ctrl + Shift + C then Ctrl +
> Shift + V. The pasting then has a strange behaviour, it looks like vim
> automatically goes back to edition mode (instead of insertion mode) at
> the beginning of the paste process, then treat the following characters
> as commands (so it will go back to insertion mode at the first "i", "a"
> or "s").
>
> This issue does not happen outside of tmux, or if TERM is set to "xterm"
> instead of "tmux". Reverting to ncurses-base 6.3+20220423-2 is another
> way to work around this unexpected behaviour.

Thanks for the report.  This is due to a feature introduced in the ncurses
Christmas patchlevel:

,----
| 20221224
|       + add/use bracketed+paste to help identify terminals supporting this
|         xterm feature (prompted by discussion with Bram Moolenaar) -TD
`----

That turned out to be botched and has been corrected in yesterday's
patchlevel (incidentally, also the ncurses 6.4 release):

,----
| 20221231 6.4 release for upload to ftp.gnu.org
|       + correct PS vs PE names in bracketed+paste (report by Bram Moolenaar)
|         -TD
`----

So far so good, and I have already prepared ncurses 6.4-1 in git.  Now
the bad news: it turned out that bracketed paste support in vim had
(always?) been broken without anybody noticing it, because no terminal
descriptions had included this feature.  Only two days ago Bram
Moolenaar fixed the problem in patch 9.0.1117[1].

I have backported this patch to the debian/sid branch in vim's git
repository and can confirm that it fixes the problem, as long as
ncurses-base is also upgraded to version 6.4-1.

Cheers,
       Sven


1. https://github.com/vim/vim/commit/7b8db111e819bcb07cff6fc451584b0e3e0a49fd

Reply via email to