From 9201d27875d9a23cd39623e6bf8decc49d01699d Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 13 Aug 2018 07:27:08 +0530 Subject: [PATCH] Document kitty's extension to the OSC 52 protocol --- docs/protocol-extensions.rst | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/docs/protocol-extensions.rst b/docs/protocol-extensions.rst index e505477a7..1163299a8 100644 --- a/docs/protocol-extensions.rst +++ b/docs/protocol-extensions.rst @@ -184,3 +184,25 @@ changes even after it exits. To avoid this, kitty introduces a new pair of These escape codes save/restore the so called *dynamic colors*, default background, default foreground, selection background, selection foreground and cursor color. + + +Pasting to clipboard +---------------------- + +|kitty| implements the OSC 52 escape code protocol to get/set the clipboard +contents (controlled via the :opt:`clipboard_control` setting). There is one +difference in kitty's implementation compared to some other terminal emulators. +|kitty| allows sending arbitrary amounts of text to the clipboard. It does so +by modifying the protocol slightly. Successive OSC 52 escape codes to set the +clipboard will concatenate, so:: + + ]52;c;\ + ]52;c;\ + +will result in the clipboard having the contents ``payload1 + payload2``. To +send a new string to the clipboard send an OSC 52 sequence with an invalid payload +first, for example:: + + ]52;c;!\ + +Here ``!`` is not valid base64 encoded text, so it clears the clipboard.