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.