bugGNU nano - Bugs: bug #58010, some terminals mistakenly paste LF...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #58010: some terminals mistakenly paste LF instead of CR

Submitter:  Benno Schulenberg <bens>
Submitted:  Thu 19 Mar 2020 08:20:11 AM UTC
   
 
Severity:  3 - Normal Status:  Fixed
Assigned to:  bens Open/Closed:  Closed

Wed 25 Mar 2020 10:05:38 AM UTC, comment #2: 

Fixed in version 4.9.

Benno Schulenberg <bens>
Group administrator
Fri 20 Mar 2020 01:28:50 PM UTC, comment #1: 

To humor the crude emulators, ^J is now accepted as a synonym of ^M during a bracketed paste.  Commit 481529e8.

Benno Schulenberg <bens>
Group administrator
Thu 19 Mar 2020 08:20:11 AM UTC, original submission:  

(Original report was by Tim Tannert by private email.  I responded to that email in https://lists.gnu.org/archive/html/nano-devel/2020-03/msg00005.html.)

It seems that some terminal emulators, when pasting, will feed the exact contents of the clipboard to whatever program is running in the terminal.  That is, if the clipboard contains multiple lines (that is: lines terminated with a LF character), it will feed these linefeeds unchanged to the running program.  This is strange.  When the user types multiple lines, they don't type ^J at the end of each line, they type <Enter>.  And <Enter> is ^M.  So if a terminal emulator wants to paste something into the running program, it should simulate the typing of the pasted text: it should translate LF to CR (and in case the clipboard contains CR+LF, it should swallow the trailing LF).

So, I don't think this is a bug in nano, but a bug in the terminal emulator.  Pasting works fine in xterm and Xfce Terminal and Gnome Terminal and urxvt -- they translate LF to CR.  Are all those emulators wrong?

Benno Schulenberg <bens>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by bens (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-03-25 bens Open/ClosedOpen Closed
    2020-03-20 bens Summarysome terminals mistakenly paste ^J instead of ^M some terminals mistakenly paste LF instead of CR
    2020-03-20 bens StatusNone Fixed
        Assigned toNone bens

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code