libghostty-vt 0.0.0
Loading...
Searching...
No Matches
GhosttyClipboardReadReply Struct Reference

#include <ghostty/vt/terminal.h>

Data Fields

size_t size
GhosttyClipboardReadResult result
const GhosttyClipboardContent * contents
size_t contents_len
const GhosttyString * available
size_t available_len
bool remember

Detailed Description

The reply to a clipboard read request.

This is a sized struct. Initialize it with GHOSTTY_INIT_SIZED(), then set the fields you need. See Sized Structs. If size is not valid, the library ignores the rest of the reply and answers as if you had replied with GHOSTTY_CLIPBOARD_READ_RESULT_UNSUPPORTED.

All arrays and the strings they point to are borrowed only for the duration of the reply call and may be freed as soon as it returns.

Any result other than GHOSTTY_CLIPBOARD_READ_RESULT_SUCCESS answers the program with an empty clipboard (OSC 52) or the matching protocol status (OSC 5522: EPERM, ENOSYS, EBUSY, EIO); the other fields are ignored in that case. On success, contents should carry one representation per requested MIME type (GhosttyClipboardRead::mimes) that the clipboard has; unrequested representations are ignored. Protocols that carry a single text value (OSC 52) use the first entry with a text MIME type such as "text/plain".

Examples
c-vt-effects/src/main.c, and c-vt-paste/src/main.c.

Definition at line 985 of file terminal.h.

Field Documentation

◆ available

const GhosttyString* available

Borrowed array of all MIME types available on the clipboard. Only used when GhosttyClipboardRead::list is set; may be NULL otherwise.

Definition at line 1002 of file terminal.h.

◆ available_len

size_t available_len

Number of entries in available.

Definition at line 1005 of file terminal.h.

◆ contents

const GhosttyClipboardContent* contents

Borrowed array of MIME representations of the clipboard contents.

Definition at line 993 of file terminal.h.

◆ contents_len

size_t contents_len

Number of entries in contents.

Definition at line 996 of file terminal.h.

◆ remember

bool remember

Record a session grant so future requests from the same program skip the permission prompt. Only honored on success when GhosttyClipboardRead::can_remember is set.

Definition at line 1012 of file terminal.h.

◆ result

Outcome of the read.

Definition at line 990 of file terminal.h.

◆ size

size_t size

Size of this struct in bytes.

Definition at line 987 of file terminal.h.


The documentation for this struct was generated from the following file: