Multi-line paste broken between kitty and nano 4.8 [focal]

Bug #1870850 reported by Ryan Finnie
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
nano (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

Ubuntu 20.04 Focal beta (as of 2020-04-04)
nano 4.8-1

What I expect to happen: multi-line paste into nano via kitty pastes multiple lines.

What happens instead: pasted multi-line text is one line with no line breaks.

There is a bit of a spat between the developers of kitty (gnome-terminal:kitty::screen:tmux, basically) and nano about how to do multi-line pasting. See e.g.:

* https://savannah.gnu.org/bugs/?58010
* https://lists.gnu.org/archive/html/nano-devel/2020-03/msg00005.html
* https://github.com/kovidgoyal/kitty/issues/994

Without taking sides, the facts are:

* With the current versions in focal (kitty 0.15.0 and nano 4.8), pasting multi-line will result in newlines being eaten.
* nano 4.9 introduces a fix (commit 481529e8650d105c3280def764e4917af0cabb49) which brings the newline handling more in line with other terminal-aware programs (treating raw \n as line break).

Peripherally, nano 4.8 introduced new bracketed paste mode support. This makes a read of the kitty github issue above harder, since the issue being reported here is about an incompatibility in bracketed paste mode between kitty and nano, not pre-bracketed ^J handling.

Ryan Finnie (fo0bar)
summary: - Multi-line paste broken between kitty ~0.15 and nano 8.4 [focal]
+ Multi-line paste broken between kitty and nano 4.8 [focal]
Revision history for this message
Benno Schulenberg (bennoschulenberg) wrote :

Please try the attached patch. Then please report back whether it fixes the issue for you.

tags: added: patch patch-accepted-upstream
tags: added: focal
Revision history for this message
Ryan Finnie (fo0bar) wrote :

Thanks Benno. Yeah, I've tested that works (albeit with s,'\r',CR_CODE, on the - line since focal is currently 4.8). I've asked -release if it's possible to get a sync exception for 4.9.1-1 from sid since focal is past the freeze, rather than trying to SRU this (and e.g. LP: #1866820 crash); waiting to heard back about that.

Revision history for this message
Benno Schulenberg (bennoschulenberg) wrote :

Thanks for the feedback. It's good to know that it works. (And sorry about having had to replace \r with CR_CODE in the patch -- I hadn't checked whether it applied cleanly to 4.8.)

When going to make a sync exception, then better wait for 4.9.2 which will come out in two days: it fixes a crash that was introduced in 4.9. (Lots of things are happening under the hood; sometimes a mistake is made.)

Mathew Hodson (mhodson)
Changed in nano (Ubuntu):
importance: Undecided → Low
Revision history for this message
Sebastien Bacher (seb128) wrote :

Thanks Benno for providing the patches, I've uploaded it to focal now (I will let other people deal wit requesting a ffe for a newer nano if wanted)

Changed in nano (Ubuntu):
status: New → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package nano - 4.8-1ubuntu1

---------------
nano (4.8-1ubuntu1) focal; urgency=medium

  * Thanks Benno Schulenberg for providing the info and patches
  * debian/patches/git_justify_segfault.patch:
    - backprot an upstream fix to avoid a segfault when justifying empty
      lines (lp: #1866820)
  * debian/patches/git_newline_paste.patch:
    - backport an upstream fix for pasting new lines via kitty (lp: #1870850)

 -- Sebastien Bacher <email address hidden> Fri, 10 Apr 2020 16:12:30 +0200

Changed in nano (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.