![]() |
libghostty
|
#include <ghostty/vt/selection.h>
Data Fields | |
| size_t | size |
| GhosttyFormatterFormat | emit |
| bool | unwrap |
| bool | trim |
| const GhosttySelection * | selection |
Options for one-shot formatting of a terminal selection.
This is a sized struct. Use GHOSTTY_INIT_SIZED() to initialize it.
If selection is NULL, the terminal's current active selection is used. If selection is non-NULL, that caller-provided snapshot selection is used.
The selection is formatted from the terminal's active screen using the same formatting semantics as GhosttyFormatter. For copy/clipboard behavior matching Ghostty's Screen.selectionString(), use plain output with unwrap and trim both set to true.
Definition at line 212 of file selection.h.
Output format to emit.
Definition at line 217 of file selection.h.
| const GhosttySelection* selection |
Optional selection to format.
If NULL, the terminal's current active selection is used. If the terminal has no active selection, formatting returns GHOSTTY_NO_VALUE.
If non-NULL, the pointed-to selection must be a valid snapshot selection for this terminal and must obey GhosttySelection lifetime rules.
Definition at line 234 of file selection.h.
| size_t size |
Size of this struct in bytes. Must be set to sizeof(GhosttyTerminalSelectionFormatOptions).
Definition at line 214 of file selection.h.
| bool trim |
Whether to trim trailing whitespace on non-blank lines.
Definition at line 223 of file selection.h.
| bool unwrap |
Whether to unwrap soft-wrapped lines.
Definition at line 220 of file selection.h.