libghostty
Loading...
Searching...
No Matches
GhosttyClipboardReadReply Struct Reference

#include <ghostty/vt/terminal.h>

Data Fields

size_t size
GhosttyClipboardReadResult result
const GhosttyClipboardContentcontents
size_t contents_len
const GhosttyStringavailable
size_t available_len
bool remember

Detailed Description

The reply to a clipboard read request.

This is a sized struct; set size to sizeof(GhosttyClipboardReadReply). 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-paste/src/main.c.

Definition at line 667 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 684 of file terminal.h.

◆ available_len

size_t available_len

Number of entries in available.

Definition at line 687 of file terminal.h.

◆ contents

const GhosttyClipboardContent* contents

Borrowed array of MIME representations of the clipboard contents.

Definition at line 675 of file terminal.h.

◆ contents_len

size_t contents_len

Number of entries in contents.

Definition at line 678 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 694 of file terminal.h.

◆ result

Outcome of the read.

Definition at line 672 of file terminal.h.

◆ size

size_t size

Size of this struct in bytes.

Definition at line 669 of file terminal.h.


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