Strip bracketed paste end sequence when pasting

This commit is contained in:
Kovid Goyal 2017-11-07 22:16:35 +05:30
parent 204b6fa3e8
commit 3a81b186b0
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -256,7 +256,8 @@ class Window:
if isinstance(text, str):
text = text.encode('utf-8')
if self.screen.in_bracketed_paste_mode:
text = BRACKETED_PASTE_START.encode('ascii') + text + BRACKETED_PASTE_END.encode('ascii')
bpe = BRACKETED_PASTE_END.encode('ascii')
text = BRACKETED_PASTE_START.encode('ascii') + text.replace(bpe, b'') + bpe
self.write_to_child(text)
def copy_to_clipboard(self):