bugGNU nano - Bugs: bug #40060, [Request] implement bracketed...

 
 

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

bug #40060: [Request] implement bracketed paste mode

Submitted by:  Egmont Koblinger <egmont>
Submitted on:  Wed 18 Sep 2013 03:41:35 PM UTC  
 
Severity:  1 - Wish Status:  None
Assigned to:  None Open/Closed:  Open

Thu 21 Feb 2019 01:46:29 PM UTC, comment #3: 

This patch sets the global 'bracketed_paste' variable to TRUE while the input buffer contains pasted characters. I wrote it a couple weeks ago but haven't gotten around to implementing an undo type for it yet. So if anyone wants to do that before I do...

(file #46324)

Brand Huntsman <brand>
Sun 04 Nov 2018 11:25:53 AM UTC, comment #2: 

Bug #54950 has been marked as a duplicate of this request.

Benno Schulenberg <bens>
Project Administrator
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>

 

Attached Files
file #46324:  0001-bracketed-paste.patch added by brand (5KiB - text/x-diff)

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

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

    Only logged-in users can vote.

     

     

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-02-21 brand Attached File- => Added 0001-bracketed-paste.patch, #46324
    2018-11-04 bens Summary[Request] bracketed paste mode => [Request] implement bracketed paste mode
    2018-02-18 bens Severity3 - Normal => 1 - Wish
    2014-06-14 bens Summary[request] bracketed paste mode => [Request] bracketed paste mode
    2014-06-13 bens SummaryBracketed paste mode => [request] bracketed paste mode

    Back to the top


    Powered by Savane 3.5