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

#include <ghostty/vt/terminal.h>

Data Fields

GhosttyClipboardLocation location
const GhosttyClipboardContent * contents
size_t contents_len
GhosttyString name
bool granted
bool can_remember
const void * ctx
GhosttyClipboardWriteReplyFn reply

Detailed Description

A synchronous request to write clipboard contents.

The request and everything it points to, including the contents array and its strings, are borrowed. They are only valid until the callback returns.

All entries in contents are representations of the same logical value and must be committed atomically. A contents_len of zero requests that the destination be cleared. This is distinct from a content entry whose data has zero length.

The write is answered by calling reply with this request and a GhosttyClipboardWriteReply. This must happen within the clipboard write request callback. This struct is only valid during that time. Calling reply more than once is safely ignored. Returning without replying denies the write.

This struct has a frozen layout and will never gain fields. It is 64 bytes on 64-bit targets and 32 bytes on wasm32. If a later version of libghostty-vt has more to report, it will add a new option with a new struct, and this callback will keep receiving this struct unchanged.

Examples
c-vt-effects/src/main.c.

Definition at line 873 of file terminal.h.

Field Documentation

◆ can_remember

bool can_remember

True if the program supplied a session password, so you may offer to remember the decision through GhosttyClipboardWriteReply::remember. When false, remember is ignored.

Definition at line 900 of file terminal.h.

◆ contents

const GhosttyClipboardContent* contents

Borrowed array of MIME representations.

Examples
c-vt-effects/src/main.c.

Definition at line 878 of file terminal.h.

◆ contents_len

size_t contents_len

Number of entries in contents; zero means clear the destination.

Examples
c-vt-effects/src/main.c.

Definition at line 881 of file terminal.h.

◆ ctx

const void* ctx

Terminal-owned reply state. Do not access.

Definition at line 903 of file terminal.h.

◆ granted

bool granted

True if the terminal already holds a session grant for this request You should skip any permission prompt and perform the write.

Definition at line 893 of file terminal.h.

◆ location

Clipboard destination.

Examples
c-vt-effects/src/main.c.

Definition at line 875 of file terminal.h.

◆ name

Name of the writing program for permission prompts, if the protocol carries one. Empty otherwise.

Definition at line 887 of file terminal.h.

◆ reply

Answer the write; see the struct documentation.

Examples
c-vt-effects/src/main.c.

Definition at line 906 of file terminal.h.


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