Bug#1027435: ncurses-base: Breaks pasting in vim within tmux

2023-01-22 Thread Sven Joachim
Control: tags -1 pending

On 2023-01-11 18:48 +0100, Sven Joachim wrote:

> On 2023-01-01 18:25 +0100, Sven Joachim wrote:
>
>> 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.
>
> James was so kind to upload this fix the next day, and so things have
> been fine in unstable since then.  However Bookworm is still broken,
> with vim currently unable to migrate because of vim-ultisnips'
> autopkgtest failure in #1028442.
>
> Once the fixed vim migrates to testing I intent to add versioned Breaks
> on vim-common to ncurses-base and ncurses-term, so that users do not
> experience the problem on partial upgrades from Bullseye, and close the
> current bug.

Vim has migrated to testing today (according to rmadison,
tracker.debian.org seems to be a bit behind), so I added the versioned
Breaks in git[1].  This should have sent out a mail which marks the bug
as pending and informs the submitter, but for some unknown reason it
didn't.  Anyway, good to see that things have been sorted out by now.

Cheers,
   Sven


1. 
https://salsa.debian.org/debian/ncurses/-/commit/12bb87e58cf0ad787b90281452404a9ee1240244



Bug#1027435: ncurses-base: Breaks pasting in vim within tmux

2023-01-11 Thread Sven Joachim
On 2023-01-01 18:25 +0100, Sven Joachim wrote:

> 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.

James was so kind to upload this fix the next day, and so things have
been fine in unstable since then.  However Bookworm is still broken,
with vim currently unable to migrate because of vim-ultisnips'
autopkgtest failure in #1028442.

Once the fixed vim migrates to testing I intent to add versioned Breaks
on vim-common to ncurses-base and ncurses-term, so that users do not
experience the problem on partial upgrades from Bullseye, and close the
current bug.

Cheers,
   Sven



Bug#1027435: ncurses-base: Breaks pasting in vim within tmux

2023-01-01 Thread Sven Joachim
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



Bug#1027435: ncurses-base: Breaks pasting in vim within tmux

2023-01-01 Thread Sven Joachim
On 2023-01-01 14:17 +0100, Sven Joachim wrote:

> On 2022-12-31 08:44 -0500, Thomas Dickey wrote:
>
>> On Sat, Dec 31, 2022 at 02:18:49PM +0100, Antoine Le Gonidec wrote:
>>> Package: ncurses-base
>>> Version: 6.3+20221224-2
>>> Severity: important
>>
>> that's probably this - which will be in today's update/release:
>>
>> --- ncurses-6.3-20221224+/misc/terminfo.src  2022-12-24 18:18:58.0 
>> +
>> +++ ncurses-6.4-20221231/misc/terminfo.src   2022-12-29 20:11:56.0 
>> +
>> @@ -6,8 +6,8 @@
>>  # Report bugs and new terminal descriptions to
>>  #   bug-ncur...@gnu.org
>>  #
>> -#   $Revision: 1.1039 $
>> -#   $Date: 2022/12/24 18:18:58 $
>> +#   $Revision: 1.1041 $
>> +#   $Date: 2022/12/29 20:11:56 $
>>  #
>>  # The original header is preserved below for reference.  It is noted that 
>> there
>>  # is a "newer" version which differs in some cosmetic details (but actually
>> @@ -5768,7 +5768,7 @@
>>  # detail.  The names for the extended capabilities here were introduced by 
>> vim
>>  # in January 2017.
>>  bracketed+paste|xterm bracketed paste,
>> -BD=\E[?2004l, BE=\E[?2004h, PD=\E[201~, PE=\E[200~,
>> +BD=\E[?2004l, BE=\E[?2004h, PE=\E[201~, PS=\E[200~,
>>
>>   XTERM Mouse
>>  # The xterm mouse protocol is used by other terminal emulators.
>> @@ -8210,7 +8210,7 @@
>>  use=screen4,
>>
>>  no+brackets|cancel bracketed paste,
>> -BD@, BE@, PD@, PE@,
>> +BD@, BE@, PE@, PS@,
>>
>>  # The bce and status-line entries are from screen 3.9.13 (and require some
>>  # changes to .screenrc).
>> @@ -25508,8 +25508,8 @@
>>  #
>>  # BE enables bracketed paste
>>  # BD disables bracketed paste
>> -# PE is sent before the pasted text
>> -# PD is sent after the pasted text
>> +# PS is sent before the pasted text
>> +# PE is sent after the pasted text
>>  #
>>  # Here are the other xterm-related extensions which are used in this file:
>>  #
>> @@ -27713,4 +27713,8 @@
>>  #   + add/use bracketed+paste to help identify terminals supporting this
>>  # xterm feature (prompted by discussion with Bram Moolenaar) -TD
>>  #
>> +# 2022-12-29
>> +#   + correct PS vs PE names in bracketed+paste (report by Bram Moolenaar)
>> +# -TD
>> +#
>>   SHANTIH!  SHANTIH!  SHANTIH!
>
> Unfortunately, this did not help here :-(.  After upgrading ncurses-base
> to 6.4-1, pasting text into vim running inside tmux still gives the same
> funny behavior the submitter described in the original report here,
> tested on unstable with vim 9.0.1000 and tmux 3.3a.
>
> Bram Moolenaar published patch 9.0.1117[1] the other day.  I have not
> tested yet whether it makes a difference, but the commit message
> ("Correct mixup of output strings and key codes.") sounds like it might
> fix the issue.

Indeed applying patch 9.0.1117 fixes the problem, provided that
ncurses-base is /also/ upgraded to 6.4-1.  With the incorrect
definitions from ncurses-base 6.3+20221224-1, pasting remains broken
even in vim 9.0.1117.

So I guess we need to clone a copy of this bug to vim and upgrade both
ncurses and vim.

Cheers,
   Sven



Bug#1027435: ncurses-base: Breaks pasting in vim within tmux

2023-01-01 Thread Sven Joachim
On 2022-12-31 08:44 -0500, Thomas Dickey wrote:

> On Sat, Dec 31, 2022 at 02:18:49PM +0100, Antoine Le Gonidec wrote:
>> Package: ncurses-base
>> Version: 6.3+20221224-2
>> Severity: important
>
> that's probably this - which will be in today's update/release:
>
> --- ncurses-6.3-20221224+/misc/terminfo.src   2022-12-24 18:18:58.0 
> +
> +++ ncurses-6.4-20221231/misc/terminfo.src2022-12-29 20:11:56.0 
> +
> @@ -6,8 +6,8 @@
>  # Report bugs and new terminal descriptions to
>  #bug-ncur...@gnu.org
>  #
> -#$Revision: 1.1039 $
> -#$Date: 2022/12/24 18:18:58 $
> +#$Revision: 1.1041 $
> +#$Date: 2022/12/29 20:11:56 $
>  #
>  # The original header is preserved below for reference.  It is noted that 
> there
>  # is a "newer" version which differs in some cosmetic details (but actually
> @@ -5768,7 +5768,7 @@
>  # detail.  The names for the extended capabilities here were introduced by 
> vim
>  # in January 2017.
>  bracketed+paste|xterm bracketed paste,
> - BD=\E[?2004l, BE=\E[?2004h, PD=\E[201~, PE=\E[200~,
> + BD=\E[?2004l, BE=\E[?2004h, PE=\E[201~, PS=\E[200~,
>
>   XTERM Mouse
>  # The xterm mouse protocol is used by other terminal emulators.
> @@ -8210,7 +8210,7 @@
>   use=screen4,
>
>  no+brackets|cancel bracketed paste,
> - BD@, BE@, PD@, PE@,
> + BD@, BE@, PE@, PS@,
>
>  # The bce and status-line entries are from screen 3.9.13 (and require some
>  # changes to .screenrc).
> @@ -25508,8 +25508,8 @@
>  #
>  # BE enables bracketed paste
>  # BD disables bracketed paste
> -# PE is sent before the pasted text
> -# PD is sent after the pasted text
> +# PS is sent before the pasted text
> +# PE is sent after the pasted text
>  #
>  # Here are the other xterm-related extensions which are used in this file:
>  #
> @@ -27713,4 +27713,8 @@
>  #+ add/use bracketed+paste to help identify terminals supporting this
>  #  xterm feature (prompted by discussion with Bram Moolenaar) -TD
>  #
> +# 2022-12-29
> +#+ correct PS vs PE names in bracketed+paste (report by Bram Moolenaar)
> +#  -TD
> +#
>   SHANTIH!  SHANTIH!  SHANTIH!

Unfortunately, this did not help here :-(.  After upgrading ncurses-base
to 6.4-1, pasting text into vim running inside tmux still gives the same
funny behavior the submitter described in the original report here,
tested on unstable with vim 9.0.1000 and tmux 3.3a.

Bram Moolenaar published patch 9.0.1117[1] the other day.  I have not
tested yet whether it makes a difference, but the commit message
("Correct mixup of output strings and key codes.") sounds like it might
fix the issue.

Cheers,
   Sven


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



Bug#1027435: ncurses-base: Breaks pasting in vim within tmux

2022-12-31 Thread Thomas Dickey
On Sat, Dec 31, 2022 at 02:18:49PM +0100, Antoine Le Gonidec wrote:
> Package: ncurses-base
> Version: 6.3+20221224-2
> Severity: important

that's probably this - which will be in today's update/release:

--- ncurses-6.3-20221224+/misc/terminfo.src 2022-12-24 18:18:58.0 
+
+++ ncurses-6.4-20221231/misc/terminfo.src  2022-12-29 20:11:56.0 
+
@@ -6,8 +6,8 @@
 # Report bugs and new terminal descriptions to
 #  bug-ncur...@gnu.org
 #
-#  $Revision: 1.1039 $
-#  $Date: 2022/12/24 18:18:58 $
+#  $Revision: 1.1041 $
+#  $Date: 2022/12/29 20:11:56 $
 #
 # The original header is preserved below for reference.  It is noted that there
 # is a "newer" version which differs in some cosmetic details (but actually
@@ -5768,7 +5768,7 @@
 # detail.  The names for the extended capabilities here were introduced by vim
 # in January 2017.
 bracketed+paste|xterm bracketed paste,
-   BD=\E[?2004l, BE=\E[?2004h, PD=\E[201~, PE=\E[200~,
+   BD=\E[?2004l, BE=\E[?2004h, PE=\E[201~, PS=\E[200~,
 
  XTERM Mouse
 # The xterm mouse protocol is used by other terminal emulators.
@@ -8210,7 +8210,7 @@
use=screen4,
 
 no+brackets|cancel bracketed paste,
-   BD@, BE@, PD@, PE@,
+   BD@, BE@, PE@, PS@,
 
 # The bce and status-line entries are from screen 3.9.13 (and require some
 # changes to .screenrc).
@@ -25508,8 +25508,8 @@
 #
 # BE enables bracketed paste
 # BD disables bracketed paste
-# PE is sent before the pasted text
-# PD is sent after the pasted text
+# PS is sent before the pasted text
+# PE is sent after the pasted text
 #
 # Here are the other xterm-related extensions which are used in this file:
 #
@@ -27713,4 +27713,8 @@
 #  + add/use bracketed+paste to help identify terminals supporting this
 #xterm feature (prompted by discussion with Bram Moolenaar) -TD
 #
+# 2022-12-29
+#  + correct PS vs PE names in bracketed+paste (report by Bram Moolenaar)
+#-TD
+#
  SHANTIH!  SHANTIH!  SHANTIH!

-- 
Thomas E. Dickey 
https://invisible-island.net


signature.asc
Description: PGP signature


Bug#1027435: ncurses-base: Breaks pasting in vim within tmux

2022-12-31 Thread Antoine Le Gonidec
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.

-- System Information:
Debian Release: bookworm/sid
  APT prefers unstable-debug
  APT policy: (500, 'unstable-debug'), (500, 'testing-debug'), (500, 
'stable-debug'), (500, 'oldstable-debug'), (500, 'unstable'), (500, 'testing'), 
(500, 'stable'), (500, 'oldstable'), (1, 'experimental-debug'), (1, 
'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 6.0.0-6-amd64 (SMP w/8 CPU threads; PREEMPT)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

-- no debconf information