![]() |
libghostty
|
#include <ghostty/vt/paste.h>
Data Fields | |
| size_t | size |
| GhosttyClipboardLocation | location |
| GhosttyPasteSource | source |
| const GhosttyString * | mimes |
| size_t | mimes_len |
| GhosttyMimeReader | reader |
| bool | allow_unsafe |
A paste of clipboard contents into the terminal.
This is a sized struct; set size to sizeof(GhosttyPaste). The MIME type array and the strings it points to are borrowed only for the duration of the ghostty_terminal_paste() call, as is everything the reader produces.
| bool allow_unsafe |
Write text that could inject commands. Call with false, confirm with the user on GHOSTTY_REJECTED, and call again with true.
| GhosttyClipboardLocation location |
| const GhosttyString* mimes |
Borrowed array of the MIME types of the representations available, in preferred order. A text paste reads and writes the first entry with a text MIME type such as "text/plain" and ignores the rest. A paste event lists every entry and reads none. May be NULL when mimes_len is zero, which is nothing to paste.
| GhosttyMimeReader reader |
Produces the data of a representation on demand. Required when mimes_len is nonzero.
Called at most once per ghostty_terminal_paste() call: for the text representation being pasted, never for anything else and never for a paste event. The MIME type requested is always an entry of mimes, passed through exactly as given there (the same pointer and length), so the callback may identify the representation by pointer or by content. A false return fails the paste with GHOSTTY_IO_ERROR.
| GhosttyPasteSource source |