Skip to main content

ProgramOptions

Struct ProgramOptions 

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

Defaults applied by Program::init_with.

Most fields take effect at init unconditionally. The three prefer_* fields are the exception: they depend on capability detection, so they do nothing until the terminal reports the matching mode as available. A Program never probes on its own, so that report only arrives if you call query_capabilities and read the replies. Without it these two fields stay dormant and the modes are never enabled.

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).

§prefer_grapheme_clusters: bool

Enable grapheme-cluster mode (DEC mode 2027) once the terminal reports it as available, so the terminal and the Screen measure text the same way. Defaults to true.

Nothing is emitted until that report arrives, which requires query_capabilities and a read loop. Set to false to keep per-code-point measurement, or call enable_grapheme_clusters yourself to opt in without waiting for a report.

§prefer_in_band_resize: bool

Enable in-band resize notifications (DEC mode 2048) once the terminal reports them as available, so resizes arrive on the event stream with pixel dimensions instead of through SIGWINCH. Defaults to true.

Nothing is emitted until that report arrives, which requires query_capabilities and a read loop. Set to false to stay on the signal path, or call enable_in_band_resize yourself to opt in without waiting for a report.

§prefer_synchronized_output: bool

Wrap each frame in synchronized-output markers (DEC mode 2026) once the terminal reports them as available, so a frame is presented in one piece instead of tearing. Defaults to true.

Unlike the two above this emits nothing of its own: synchronized output is a render property, so adopting it only tells the Screen to start bracketing frames. Set to false to keep frames unwrapped for the whole session. Screen::set_synchronized_output drives the same property directly, but the program cannot see a choice made there, so a call made before the terminal’s first report is still overridden by adoption; use this field when the decision has to hold from the start.

Trait Implementations§

Source§

impl Clone for ProgramOptions

Source§

fn clone(&self) -> ProgramOptions

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> 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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.