bugGNU nano - Bugs: bug #40060, [Request] bracketed paste mode


bug #40060: [Request] 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

Add a New Comment(Rich 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 Files:

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 (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 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    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.3