Workaround for broken editors like nano that cannot handle newlines in pasted text
Fixes #994
This commit is contained in:
@@ -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`)
|
||||
|
||||
|
||||
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user