#[repr(C)]pub struct TerminalSelectionFormatOptions {
pub size: usize,
pub emit: Type,
pub unwrap: bool,
pub trim: bool,
pub selection: *const Selection,
}Expand description
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.
Fields§
§size: usizeSize of this struct in bytes. Must be set to sizeof(GhosttyTerminalSelectionFormatOptions).
emit: TypeOutput format to emit.
unwrap: boolWhether to unwrap soft-wrapped lines.
trim: boolWhether to trim trailing whitespace on non-blank lines.
selection: *const SelectionOptional 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.
Trait Implementations§
Source§impl Clone for TerminalSelectionFormatOptions
impl Clone for TerminalSelectionFormatOptions
Source§fn clone(&self) -> TerminalSelectionFormatOptions
fn clone(&self) -> TerminalSelectionFormatOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more