Dont use splitlines() to replace \n with \r in pasted text

splitlines breaks on a whole bunch of characters besides \r and \n.
This commit is contained in:
Kovid Goyal 2020-02-11 08:16:20 +05:30
parent 9007623d0c
commit 18751a05c0
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -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):