This commit is contained in:
Kovid Goyal 2026-06-06 18:36:29 +05:30
parent 2d9e243847
commit 6839281277
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C

View file

@ -15,7 +15,7 @@ of the escape code is::
<OSC>5522;metadata;payload<ST> <OSC>5522;metadata;payload<ST>
Here, *metadata* is a colon separated list of key-value pairs and payload is Here, *metadata* is a colon separated list of key-value pairs and payload is
base64 encoded data. :code:`OSC` is :code:`<ESC>[`. base64 encoded data. :code:`OSC` is :code:`<ESC>]`.
:code:`ST` is the string terminator, :code:`<ESC>\\`. :code:`ST` is the string terminator, :code:`<ESC>\\`.
Reading data from the system clipboard Reading data from the system clipboard
@ -29,11 +29,11 @@ For example, to read plain text and PNG data, the payload would be::
text/plain image/png text/plain image/png
encoded as base64. To read from the primary selection instead of the encoded as :rfc:`base64 <4648>`. To read from the primary selection instead of the
clipboard, add the key ``loc=primary`` to the metadata section. clipboard, add the key ``loc=primary`` to the metadata section.
To get the list of MIME types available on the clipboard the payload must be To get the list of MIME types available on the clipboard the payload must be
just a period (``.``), encoded as base64. just a period (``.``), encoded as :rfc:`base64 <4648>`.
The terminal emulator will reply with a sequence of escape codes of the form:: The terminal emulator will reply with a sequence of escape codes of the form::
@ -51,7 +51,8 @@ for an individual type, into chunks of size **no more** than 4096 bytes (4096
is the size of a chunk *before* base64 encoding). All 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. base64 padding bytes are required at
the end of every base64 encoded chunk when padding is needed.
If an error occurs, instead of the opening ``status=OK`` packet the terminal If an error occurs, instead of the opening ``status=OK`` packet the terminal
must send a ``status=ERRORCODE`` packet. The error code must be one of: must send a ``status=ERRORCODE`` packet. The error code must be one of: