mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-05-13 08:26:56 +00:00
Clarify that the size limit refers to size of data before base64 encoding
This commit is contained in:
parent
fc8e678eb5
commit
0eb4959a56
2 changed files with 8 additions and 4 deletions
|
|
@ -47,7 +47,8 @@ The terminal emulator will reply with a sequence of escape codes of the form::
|
|||
|
||||
Here, the ``status=DATA`` packets deliver the data (as base64 encoded bytes)
|
||||
associated with each MIME type. The terminal emulator should chunk up the data
|
||||
for an individual type, into chunks of size **no more** than 4096 bytes. All
|
||||
for an individual type, into chunks of size **no more** than 4096 bytes (4096
|
||||
is the size of a chunk *before* base64 encoding). All
|
||||
the chunks for a given type must be transmitted sequentially and only once they
|
||||
are done the chunks for the next type, if any, should be sent. The end of data
|
||||
is indicated by a ``status=DONE`` packet.
|
||||
|
|
@ -90,7 +91,8 @@ following sequence of packets::
|
|||
|
||||
The final packet with no mime and no data indicates end of transmission. The
|
||||
data for every MIME type should be split into chunks of no more than 4096
|
||||
bytes. All the chunks for a given MIME type must be sent sequentially, before
|
||||
bytes (4096 is the size of the data before base64 encoding).
|
||||
All the chunks for a given MIME type must be sent sequentially, before
|
||||
sending chunks for the next MIME type. After the transmission is complete, the
|
||||
terminal replies with a single packet indicating success::
|
||||
|
||||
|
|
|
|||
|
|
@ -24,6 +24,8 @@ from .fast_data_types import (
|
|||
)
|
||||
from .utils import log_error
|
||||
|
||||
READ_RESPONSE_CHUNK_SIZE = 4096
|
||||
|
||||
|
||||
class Tempfile:
|
||||
|
||||
|
|
@ -462,8 +464,8 @@ class ClipboardRequestManager:
|
|||
assert w is not None
|
||||
mv = memoryview(data)
|
||||
while mv:
|
||||
w.screen.send_escape_code_to_child(ESC_OSC, rr.encode_response(payload=mv[:4096], mime=current_mime))
|
||||
mv = mv[4096:]
|
||||
w.screen.send_escape_code_to_child(ESC_OSC, rr.encode_response(payload=mv[:READ_RESPONSE_CHUNK_SIZE], mime=current_mime))
|
||||
mv = mv[READ_RESPONSE_CHUNK_SIZE:]
|
||||
|
||||
for mime in rr.mime_types:
|
||||
current_mime = mime
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue