mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-28 11:11:47 +02:00
Clarify that the size limit refers to size of data before base64 encoding
This commit is contained in:
@@ -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)
|
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
|
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
|
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
|
are done the chunks for the next type, if any, should be sent. The end of data
|
||||||
is indicated by a ``status=DONE`` packet.
|
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
|
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
|
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
|
sending chunks for the next MIME type. After the transmission is complete, the
|
||||||
terminal replies with a single packet indicating success::
|
terminal replies with a single packet indicating success::
|
||||||
|
|
||||||
|
|||||||
@@ -24,6 +24,8 @@ from .fast_data_types import (
|
|||||||
)
|
)
|
||||||
from .utils import log_error
|
from .utils import log_error
|
||||||
|
|
||||||
|
READ_RESPONSE_CHUNK_SIZE = 4096
|
||||||
|
|
||||||
|
|
||||||
class Tempfile:
|
class Tempfile:
|
||||||
|
|
||||||
@@ -462,8 +464,8 @@ class ClipboardRequestManager:
|
|||||||
assert w is not None
|
assert w is not None
|
||||||
mv = memoryview(data)
|
mv = memoryview(data)
|
||||||
while mv:
|
while mv:
|
||||||
w.screen.send_escape_code_to_child(ESC_OSC, rr.encode_response(payload=mv[:4096], mime=current_mime))
|
w.screen.send_escape_code_to_child(ESC_OSC, rr.encode_response(payload=mv[:READ_RESPONSE_CHUNK_SIZE], mime=current_mime))
|
||||||
mv = mv[4096:]
|
mv = mv[READ_RESPONSE_CHUNK_SIZE:]
|
||||||
|
|
||||||
for mime in rr.mime_types:
|
for mime in rr.mime_types:
|
||||||
current_mime = mime
|
current_mime = mime
|
||||||
|
|||||||
Reference in New Issue
Block a user