Skip to main content

CapabilityOverride

Struct CapabilityOverride 

Source
pub struct CapabilityOverride {
Show 16 fields pub true_color: Option<bool>, pub colors_256: Option<bool>, pub unicode_box_drawing: Option<bool>, pub unicode_emoji: Option<bool>, pub double_width: Option<bool>, pub sync_output: Option<bool>, pub osc8_hyperlinks: Option<bool>, pub scroll_region: Option<bool>, pub in_tmux: Option<bool>, pub in_screen: Option<bool>, pub in_zellij: Option<bool>, pub kitty_keyboard: Option<bool>, pub focus_events: Option<bool>, pub bracketed_paste: Option<bool>, pub mouse_sgr: Option<bool>, pub osc52_clipboard: Option<bool>,
}
Expand description

Override specification for terminal capabilities.

Each field is Option<bool>:

  • Some(true) - Force capability ON
  • Some(false) - Force capability OFF
  • None - Don’t override (use base or previous override)

Fields§

§true_color: Option<bool>§colors_256: Option<bool>§unicode_box_drawing: Option<bool>§unicode_emoji: Option<bool>§double_width: Option<bool>§sync_output: Option<bool>§osc8_hyperlinks: Option<bool>§scroll_region: Option<bool>§in_tmux: Option<bool>§in_screen: Option<bool>§in_zellij: Option<bool>§kitty_keyboard: Option<bool>§focus_events: Option<bool>§bracketed_paste: Option<bool>§mouse_sgr: Option<bool>§osc52_clipboard: Option<bool>

Implementations§

Source§

impl CapabilityOverride

Source

pub const fn new() -> Self

Create a new empty override (no fields overridden).

Source

pub const fn dumb() -> Self

Create an override that disables all capabilities (dumb terminal).

Source

pub const fn modern() -> Self

Create an override that enables all capabilities (modern terminal).

Source

pub const fn tmux() -> Self

Create an override that simulates running inside tmux.

Source

pub const fn true_color(self, value: Option<bool>) -> Self

Override true color support.

Source

pub const fn colors_256(self, value: Option<bool>) -> Self

Override 256-color support.

Source

pub const fn unicode_box_drawing(self, value: Option<bool>) -> Self

Override Unicode box drawing support.

Source

pub const fn unicode_emoji(self, value: Option<bool>) -> Self

Override emoji glyph support.

Source

pub const fn double_width(self, value: Option<bool>) -> Self

Override double-width glyph support.

Source

pub const fn sync_output(self, value: Option<bool>) -> Self

Override synchronized output support.

Override OSC 8 hyperlinks support.

Source

pub const fn scroll_region(self, value: Option<bool>) -> Self

Override scroll region support.

Source

pub const fn in_tmux(self, value: Option<bool>) -> Self

Override tmux detection.

Source

pub const fn in_screen(self, value: Option<bool>) -> Self

Override GNU screen detection.

Source

pub const fn in_zellij(self, value: Option<bool>) -> Self

Override Zellij detection.

Source

pub const fn kitty_keyboard(self, value: Option<bool>) -> Self

Override Kitty keyboard protocol support.

Source

pub const fn focus_events(self, value: Option<bool>) -> Self

Override focus events support.

Source

pub const fn bracketed_paste(self, value: Option<bool>) -> Self

Override bracketed paste mode support.

Source

pub const fn mouse_sgr(self, value: Option<bool>) -> Self

Override SGR mouse protocol support.

Source

pub const fn osc52_clipboard(self, value: Option<bool>) -> Self

Override OSC 52 clipboard support.

Source

pub const fn is_empty(&self) -> bool

Check if any capability is overridden.

Source

pub fn apply_to(&self, caps: TerminalCapabilities) -> TerminalCapabilities

Apply this override on top of base capabilities.

Trait Implementations§

Source§

impl Clone for CapabilityOverride

Source§

fn clone(&self) -> CapabilityOverride

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for CapabilityOverride

Source§

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

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

impl Default for CapabilityOverride

Source§

fn default() -> CapabilityOverride

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