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, to suppress auto-indentation

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

Jump to the original submission

Sun 09 Feb 2020 10:19:49 AM UTC, comment #7: 

Bracketed pasting has been released in version 4.8.

Benno Schulenberg <bens>
Group administrator
Sun 19 Jan 2020 01:56:59 PM UTC, comment #6: 

(Now fixed differently by commit 0e6d693d, which mainly fixes bug #54950.)

Benno Schulenberg <bens>
Group administrator
Sun 12 Jan 2020 10:46:39 AM UTC, comment #5: 

Fixed in git, through commits f705a967 and 7d483987.  Thanks for the ground-laying patch.

Benno Schulenberg <bens>
Group administrator
Fri 03 Jan 2020 03:05:00 PM UTC, comment #4: 

Bug #54950 has been unduplicated from this bug.  That bug is about undoing the pasted insertion as a whole, not about temporarily switching off auto-indent and hard-wrapping.

The request in bug #57527 is in fact a (more limited) duplicate of this one.

Benno Schulenberg <bens>
Group administrator
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>
Group 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>

 

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

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)
  •  

    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 9 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-02-09 bens Open/ClosedOpen Closed
    2020-01-12 bens StatusNone Fixed
        Summary[Request] implement bracketed paste mode [Request] implement bracketed paste mode, to suppress auto-indentation
    2020-01-03 bens Assigned toNone bens
    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.13-4448.
    Corresponding source code