Fix a bug when copying large amounts of text with OSC 52 introduced by the new multi-format clipboard support

This commit is contained in:
Kovid Goyal 2023-01-10 09:29:54 +05:30
parent 836b652f4d
commit bf8d0c9732
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -279,8 +279,10 @@ class WriteRequest:
extra = 4 - len(self.current_leftover_bytes)
if len(data) >= extra:
self.write_base64_data(memoryview(bytes(self.current_leftover_bytes) + data[:extra]))
data = memoryview(data)[extra:]
self.current_leftover_bytes = memoryview(b'')
data = memoryview(data)[extra:]
if len(data) > 0:
self.write_base64_data(data)
else:
self.current_leftover_bytes = memoryview(bytes(self.current_leftover_bytes) + data)
else: