mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-08-28 12:21:55 +00:00
Fix debug print for long strings
This commit is contained in:
parent
b70c72fc3b
commit
af956f4d84
1 changed files with 4 additions and 2 deletions
|
|
@ -46,8 +46,10 @@ def debug_write(*a: Any, **kw: Any) -> None:
|
|||
kw['file'] = buf
|
||||
print(*a, **kw)
|
||||
stext = buf.getvalue()
|
||||
text = b'\x1bP@kitty-print|' + standard_b64encode(stext.encode('utf-8')) + b'\x1b\\'
|
||||
fobj.write(text)
|
||||
for i in range(0, len(stext), 256):
|
||||
chunk = stext[i:i + 256]
|
||||
text = b'\x1bP@kitty-print|' + standard_b64encode(chunk.encode('utf-8')) + b'\x1b\\'
|
||||
fobj.write(text)
|
||||
fobj.flush()
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue