From 3a81b186b0bcc0f7b04fc74acb8b1f91f81faa33 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 7 Nov 2017 22:16:35 +0530 Subject: [PATCH] Strip bracketed paste end sequence when pasting --- kitty/window.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kitty/window.py b/kitty/window.py index c38daa59b..e4c63af9b 100644 --- a/kitty/window.py +++ b/kitty/window.py @@ -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):