Please support xterm bracketed paste mode
@jtriplett
Submitted by Josh Triplett Link to original bug (#605299)
Description
Xterm has a bracketed paste mode, in which it will send \e[200~ before pasted text and \e[201~ after pasted text. This allows programs to distinguish pasted text from typed text. For example, the following vim script will make vim automatically use paste mode for pastes, avoiding unwanted duplicate indentation or formatting:
if &term == "xterm"
let &t_ti = &t_ti . "\e[?2004h"
let &t_te = "\e[?2004l" . &t_te
function XTermPasteBegin(ret)
set pastetoggle=<Esc>
[201~
set paste
return a:ret
endfunction
map <expr>
<Esc>
[200~ XTermPasteBegin("i")
imap <expr>
<Esc>
[200~ XTermPasteBegin("")
endif
xterm itself supports bracketed paste mode, but vte does not, and thus neither do gnome-terminal and other terminals built on vte.
http://invisible-island.net/xterm/ctlseqs/ctlseqs.html documents the details of bracketed paste mode. \e[?2004h turns on bracketed paste mode, and \e[?2004l turns it off.
Version: 0.22.x
Resolution: RESOLVED FIXED