bugGNU nano - Bugs: bug #40060, Bracketed paste mode

 
 

bug #40060: Bracketed paste mode

Submitted by:  Egmont Koblinger <egmont>
Submitted on:  Wed 18 Sep 2013 03:41:35 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: None
Privacy: PublicAssigned to: None
Open/Closed: OpenRelease: None

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Wed 18 Sep 2013 03:49:55 PM UTC, comment #1:

(Sorry, I meant ^[?2004h and ^[?2004l.)

Egmont Koblinger <egmont>
Wed 18 Sep 2013 03:41:35 PM UTC, original submission:

Please consider supporting bracketed paste mode (http://invisible-island.net/xterm/ctlseqs/ctlseqs.html#Bracketed%20Paste%20Mode), supported by many terminals.

Enable by outputting ^[[2004h after switching to the alternate screen, disable by ^[[2004l before switching back.

If any user data is pasted (by mouse or terminal's shortcut keys or meny entry), rather than typed in from the keyboard, it will be surrounded by ^[[200~ and ^[[201~.

The desired behavior is to turn off word wrapping and auto indentation for pasted data; perhaps also turn off tab->spaces conversion. So that when e.g. source code is pasted, it won't get that well-known ever-increasing indentation.

The current code around get_escape_seq_kbinput() expects that if there's an escape sequence in the input buffer then there's no data following it, or it gets dropped. Detecting the incoming escapes near "F9 on VT220/VT320/Linux console/xterm/rxvt/Eterm" is easy but then unfortunately the actual pasted data gets dropped. This would require infrastructure change to keep and later process the non-consumed characters. That would be a good change anyways since the current design looks fragile. (I'm really not sure that multiple layers of terminal multiplexers, network connections, whatnot cannot combine two keypresses into a single read() call which is now handled incorrectly.)

Egmont Koblinger <egmont>

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by egmont (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    No Changes Have Been Made to This Item

    Back to the top


    Powered by Savane 3.1-cleanup