Workaround for broken editors like nano that cannot handle newlines in pasted text

Fixes #994
This commit is contained in:
Kovid Goyal
2018-09-20 09:08:29 +05:30
parent 4a04f27fde
commit 3f0b52bef4
2 changed files with 7 additions and 0 deletions

View File

@@ -37,6 +37,9 @@ Changelog
- Fix drag-scrolling not working when the mouse leaves the window confines
(:iss:`917`)
- Workaround for broken editors like nano that cannot handle newlines in pasted text
(:iss:`994`)
- Linux: Ensure that the python embedded in the kitty binary build uses
UTF-8 mode to process command-line arguments (:iss:`924`)

View File

@@ -478,6 +478,10 @@ class Window:
if len(text) == len(new_text):
break
text = new_text
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())
self.screen.paste(text)
def copy_to_clipboard(self):