Query or Change Clipboard Data (OSC 52)
Query or change data on clipboards.
- 0x1B
- ESC
- 0x5D
- ]
- 0x35 0x32
- 52
- 0x3B
- ;
- ____
- t
- 0x3B
- ;
- ____
- d
- 0x1B
- ESC
- 0x5C
- \
Query or change data on clipboards specified by t based on the
value of d.
t is a list of zero or more characters that each correspond to
a different type of clipboard on the system. The meaning of each character
in t as defined by xterm is as follows:
t | Type |
|---|---|
c | Standard clipboard |
p | Primary clipboard |
q | Secondary clipboard |
s | Selection clipboard |
0–7 | Cut-buffer 0–7 |
Note
Ghostty only recognizes
c,p, andsas valid values int. Other types are treated as aliases forc. Whentis omitted, Ghostty defaults to querying or modifying the primary clipboard (equivalent toc).
Warning
Ghostty currently only allows specifying one clipboard per sequence. This is a limitation on our end and may be fixed in the future.
When d is the single character ?, the terminal will reply with
another OSC 52 sequence with the data found from the first clipboard
listed in t that contains the requested data.
Otherwise, d is expected to be a Base64-encoded string that contains
the new data for all clipboards listed in t.
If d is neither a valid Base64-encoded string or the character ?,
all clipboards listed in t are cleared.