From 18751a05c09a4231d4e987b6ac3f71b10c600893 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 11 Feb 2020 08:16:20 +0530 Subject: [PATCH] Dont use splitlines() to replace \n with \r in pasted text splitlines breaks on a whole bunch of characters besides \r and \n. --- kitty/window.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kitty/window.py b/kitty/window.py index 9be4db127..b199a569a 100644 --- a/kitty/window.py +++ b/kitty/window.py @@ -572,7 +572,7 @@ class Window: else: # Workaround for broken editors like nano that cannot handle # newlines in pasted text see https://github.com/kovidgoyal/kitty/issues/994 - text = b'\r'.join(text.splitlines()) + text = text.replace(b'\r\n', b'\n').replace(b'\n', b'\r') self.screen.paste(text) def copy_to_clipboard(self):