![]() |
libghostty
|
#include <ghostty/vt/terminal.h>
Data Fields | |
| size_t | size |
| GhosttyClipboardLocation | location |
| const GhosttyString * | mimes |
| size_t | mimes_len |
| bool | list |
| GhosttyString | name |
| bool | granted |
| bool | can_remember |
| const void * | ctx |
| GhosttyClipboardReadReplyFn | reply |
A synchronous request to read clipboard contents.
This is a sized struct. The callback must only access fields present in the size reported by size. The request is borrowed and valid only for the callback duration.
The read is answered by calling reply with this request and a GhosttyClipboardReadReply. This must happen before the callback returns; the request is invalid afterwards. Calling reply more than once is ignored. Returning without replying answers the program with an empty clipboard (OSC 52) or EPERM (OSC 5522).
Definition at line 727 of file terminal.h.
| bool can_remember |
True if the program supplied a session password, so the embedder may offer to remember the user's decision through GhosttyClipboardReadReply::remember. When false, remember is ignored.
Definition at line 773 of file terminal.h.
| const void* ctx |
Terminal-owned reply state. Do not access.
Definition at line 776 of file terminal.h.
| bool granted |
True if the terminal already holds a session grant for this request (kitty clipboard protocol passwords). The embedder should skip any permission prompt and serve the read.
Always false when mimes_len is zero: such a request is served without a prompt (see the callback docs), so the terminal never consults grants for it and a one-time password is preserved for the follow-up data read.
Definition at line 766 of file terminal.h.
| bool list |
True if the program also wants the list of MIME types available on the clipboard, delivered through GhosttyClipboardReadReply::available.
Definition at line 748 of file terminal.h.
| GhosttyClipboardLocation location |
Clipboard to read.
Definition at line 732 of file terminal.h.
| const GhosttyString* mimes |
Borrowed array of the MIME types the program wants, in order of preference. Protocols that only carry text (OSC 52) request "text/plain". NULL when mimes_len is zero.
Definition at line 739 of file terminal.h.
| size_t mimes_len |
Number of entries in mimes.
Definition at line 742 of file terminal.h.
| GhosttyString name |
Name of the requesting program for permission prompts, if the protocol carries one. Empty otherwise.
Definition at line 754 of file terminal.h.
Answer the read; see the struct documentation.
Definition at line 779 of file terminal.h.
| size_t size |
Size of this struct in bytes.
Definition at line 729 of file terminal.h.