Skip to main content

ProgramOptions

Struct ProgramOptions 

Source
pub struct ProgramOptions {
    pub bracketed_paste: bool,
    pub mouse: Option<MouseTracking>,
    pub color_profile: Option<Profile>,
    pub legacy_keys: DecoderFlags,
    pub prefer_grapheme_clusters: bool,
    pub prefer_in_band_resize: bool,
    pub prefer_synchronized_output: bool,
}
Expand description

Options for session setup.

Constructors store these options. Program::init applies startup settings, and Program::apply_defaults uses the adoption preferences. Probe selects queries.

Fields§

§bracketed_paste: bool

Enable bracketed paste at init. Defaults to true.

§mouse: Option<MouseTracking>

Enable mouse tracking at init with the given MouseTracking extras (see Program::enable_mouse). The request is emitted unconditionally; terminals ignore modes they do not support and degrade gracefully. Defaults to None (mouse tracking off).

§color_profile: Option<Profile>

Select the initial renderer color profile.

None detects the profile from the environment and output terminal. Some(profile) uses the supplied profile, including for redirected output. apply_defaults can later upgrade it to truecolor when the terminal reports direct-color support.

§legacy_keys: DecoderFlags

How to read the ambiguous legacy keys.

Defaults to empty. LF reads as Ctrl+J; DecoderFlags::LF_IS_ENTER selects Enter instead. See DecoderFlags for all mappings. Use Program::set_decoder_flags to change the active flags after initialization.

§prefer_grapheme_clusters: bool

Adopt grapheme-cluster mode when the capability record confirms support.

Defaults to true. Takes effect through Program::apply_defaults, after a support reply. An explicit mode choice takes precedence.

§prefer_in_band_resize: bool

Adopt in-band resize when the capability record confirms support.

Defaults to true. Takes effect through Program::apply_defaults, after a support reply. An explicit mode choice takes precedence.

§prefer_synchronized_output: bool

Adopt synchronized output when the capability record confirms support.

Defaults to true. Takes effect through Program::apply_defaults. The first supporting record settles this preference, including an opt-out. Use this preference for a session-wide choice.

Implementations§

Source§

impl ProgramOptions

Source

pub const fn new() -> Self

Create options with optional modes and decoder flags disabled.

The color profile is detected from the environment and output. Program::init still enters raw mode and sets up the session. Default also enables bracketed paste.

Trait Implementations§

Source§

impl Clone for ProgramOptions

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ProgramOptions

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ProgramOptions

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.