Skip to main content

Mode

Enum Mode 

Source
pub enum Mode {
    Ansi(u16),
    Dec(u16),
}
Expand description

A terminal mode addressable by ANSI SM/RM or DECSET/DECRST.

Mode::Ansi writes ordinary CSI mode numbers such as ESC [ 4 h; Mode::Dec writes private mode numbers with ?, such as ESC [ ? 1049 h.

Variants§

§

Ansi(u16)

Standard ANSI mode number.

Set/reset/request forms use ESC [ <number> h, ESC [ <number> l, and ESC [ <number> $ p.

§

Dec(u16)

DEC private mode number.

Set/reset/request forms use ESC [ ? <number> h, ESC [ ? <number> l, and ESC [ ? <number> $ p.

Implementations§

Source§

impl Mode

Source

pub const CURSOR_KEYS: Mode

DEC private mode 1 (DECCKM): cursor keys send application sequences when set and normal cursor sequences when reset.

Source

pub const ANSI_VT52: Mode

DEC private mode 2 (DECANM): selects ANSI mode when set and VT52 mode when reset on terminals that implement it.

Source

pub const COLUMN_132: Mode

DEC private mode 3 (DECCOLM): 132-column mode when set; commonly resets margins and clears display on supporting terminals.

Source

pub const SMOOTH_SCROLL: Mode

DEC private mode 4 (DECSCLM): smooth scrolling when set, jump scrolling when reset.

Source

pub const REVERSE_VIDEO: Mode

DEC private mode 5 (DECSCNM): reverse-video screen mode.

Source

pub const ORIGIN: Mode

DEC private mode 6 (DECOM): absolute cursor positions are relative to the scroll region when set.

Source

pub const AUTO_WRAP: Mode

DEC private mode 7 (DECAWM): automatically wrap at the right margin when set.

Source

pub const AUTO_REPEAT: Mode

DEC private mode 8 (DECARM): key auto-repeat enabled when set.

Source

pub const MOUSE_X10: Mode

DEC private mode 9: X10 mouse reporting.

Source

pub const PRINT_FORM_FEED: Mode

DEC private mode 18 (DECPFF): print form-feed mode.

Source

pub const PRINT_EXTENT: Mode

DEC private mode 19 (DECPEX): print extent mode.

Source

pub const CURSOR_VISIBLE: Mode

DEC private mode 25 (DECTCEM): cursor visible when set, hidden when reset.

Source

pub const NO_CLEAR_COLUMN: Mode

DEC private mode 40 (DECNCSM): allow column-mode changes without clearing on supporting terminals.

Source

pub const NUMERIC_KEYPAD: Mode

DEC private mode 66 (DECNKM): keypad application/numeric behavior; see crate::ansi::keypad.

Source

pub const BACKARROW_KEY: Mode

DEC private mode 67 (DECBKM): backarrow key sends backspace/delete according to set/reset state.

Source

pub const LEFT_RIGHT_MARGIN: Mode

DEC private mode 69 (DECLRMM): enables left/right margin interpretation for DECSLRM.

Source

pub const ALT_SCREEN_LEGACY: Mode

DEC private mode 47: legacy alternate screen buffer.

Source

pub const MOUSE_NORMAL: Mode

DEC private mode 1000: report mouse button press/release events.

Source

pub const MOUSE_HIGHLIGHT: Mode

DEC private mode 1001: highlight mouse tracking.

Source

pub const MOUSE_BUTTON: Mode

DEC private mode 1002: report button-motion mouse events.

Source

pub const MOUSE_ANY: Mode

DEC private mode 1003: report any-motion mouse events.

Source

pub const FOCUS: Mode

DEC private mode 1004: enable focus in/out reports (ESC [ I / ESC [ O).

Source

pub const MOUSE_UTF8: Mode

DEC private mode 1005: UTF-8 mouse coordinate encoding.

Source

pub const MOUSE_SGR: Mode

DEC private mode 1006: SGR mouse coordinate encoding.

Source

pub const MOUSE_URXVT: Mode

DEC private mode 1015: alternate mouse coordinate encoding.

Source

pub const MOUSE_SGR_PIXEL: Mode

DEC private mode 1016: SGR-pixel mouse coordinate encoding.

Source

pub const ALT_SCREEN: Mode

Alternate screen buffer (1047).

Source

pub const SAVE_CURSOR: Mode

DEC private mode 1048: save/restore cursor around mode set/reset.

Source

pub const ALT_SCREEN_SAVE_CURSOR: Mode

DEC private mode 1049: alternate screen buffer with cursor save/restore and clear semantics.

Source

pub const BRACKETED_PASTE: Mode

DEC private mode 2004: wrap pasted data in bracketed-paste delimiters.

Source

pub const SYNCHRONIZED_OUTPUT: Mode

DEC private mode 2026: synchronized output batching.

Source

pub const UNICODE_CORE: Mode

DEC private mode 2027: Unicode core keyboard/input behavior on supporting terminals.

Source

pub const LIGHT_DARK: Mode

DEC private mode 2031: light/dark color-scheme notifications.

Source

pub const IN_BAND_RESIZE: Mode

DEC private mode 2048: in-band resize reports.

Source

pub const WIN32_INPUT: Mode

DEC private mode 9001: Win32-input reporting on supporting terminals.

Source§

impl Mode

Source

pub const KEYBOARD_ACTION: Mode

ANSI mode 2 (KAM): keyboard action mode.

Source

pub const INSERT: Mode

ANSI mode 4 (IRM): insert mode when set, replace mode when reset.

Source

pub const BIDI_SUPPORT: Mode

ANSI mode 8 (BDSM): bidirectional-support mode.

Source

pub const SEND_RECEIVE: Mode

ANSI mode 12 (SRM): send/receive mode, often associated with local echo behavior.

Source

pub const LINE_FEED_NEW_LINE: Mode

ANSI mode 20 (LNM): line-feed/new-line handling mode.

Source§

impl Mode

Source

pub fn set<W: Write>(self, w: &mut W) -> Result<()>

Write the set-mode sequence for this single mode.

This is a convenience wrapper around write_set_mode.

Source

pub fn reset<W: Write>(self, w: &mut W) -> Result<()>

Write the reset-mode sequence for this single mode.

This is a convenience wrapper around write_reset_mode.

Source

pub fn request<W: Write>(self, w: &mut W) -> Result<()>

Request this mode’s current state with DECRQM/RQM.

DEC modes emit ESC [ ? <mode> $ p; ANSI modes emit ESC [ <mode> $ p.

Trait Implementations§

Source§

impl Clone for Mode

Source§

fn clone(&self) -> Mode

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 Mode

Source§

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

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

impl Hash for Mode

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for Mode

Source§

fn eq(&self, other: &Mode) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for Mode

Source§

impl Eq for Mode

Source§

impl StructuralPartialEq for Mode

Auto Trait Implementations§

§

impl Freeze for Mode

§

impl RefUnwindSafe for Mode

§

impl Send for Mode

§

impl Sync for Mode

§

impl Unpin for Mode

§

impl UnsafeUnpin for Mode

§

impl UnwindSafe for Mode

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

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