Skip to main content

TermEvent

Enum TermEvent 

Source
pub enum TermEvent {
Show 16 variants Title(String), Bell, Cwd(String), ColumnMode { cols: usize, }, ColorSchemeQuery, SetPaletteColor { index: u8, spec: String, }, SetForeground(String), SetBackground(String), ResetPaletteColor(Option<u8>), QueryPaletteColor { index: u8, }, ResetForeground, ResetBackground, QueryForeground, QueryBackground, MarkerDisposed(MarkerId), MarkerCreated { id: MarkerId, line: u32, kind: MarkerKind, },
}
Expand description

A consumer-facing event emitted while parsing the VT stream.

Variants§

§

Title(String)

The window/icon title was set (OSC 0 or OSC 2).

§

Bell

The terminal bell rang (BEL, 0x07).

§

Cwd(String)

The working directory was reported (OSC 7), e.g. file://host/path.

§

ColumnMode

The app requested 80/132-column mode (DECCOLM ?3). justerm is dimension-free, so this is a request — the consumer may honor it by calling resize(cols, rows), or ignore it. cols is 80 or 132 (#82).

Fields

§cols: usize
§

ColorSchemeQuery

The app queried the light/dark color scheme (DSR CSI ? 996 n). justerm is theme-agnostic, so the consumer (which knows the scheme) answers by calling Engine::report_color_scheme (#85).

§

SetPaletteColor

The app set ANSI palette entry index to spec (OSC 4). One event per index ; spec pair in the sequence. The cell still references Indexed(index) — only the consumer’s palette[index] changes, so the engine stays theme-agnostic (#122).

Fields

§index: u8
§spec: String
§

SetForeground(String)

The app set the default foreground colour (OSC 10). Raw spec, forwarded for the consumer to apply — theme-agnostic, like SetBackground (#122).

§

SetBackground(String)

The app set the default background colour (OSC 11). The engine is theme-agnostic, so it forwards the raw spec string (rgb:…/#…) for the consumer to parse and apply to its palette — it never holds hex (#122).

§

ResetPaletteColor(Option<u8>)

The app reset palette entries to the theme default (OSC 104). None = the whole table (no argument); Some(index) = one entry, one event per index given. The consumer restores its palette (#122).

§

QueryPaletteColor

The app queried ANSI palette entry index (OSC 4 with ? for that pair); the consumer answers with report_palette_color (#122).

Fields

§index: u8
§

ResetForeground

The app reset the default foreground to the theme default (OSC 110, #122).

§

ResetBackground

The app reset the default background to the theme default (OSC 111, #122).

§

QueryForeground

The app queried the default foreground colour (OSC 10 with ?); the consumer answers with report_foreground (#122).

§

QueryBackground

The app queried the default background colour (OSC 11 with ?). The theme-agnostic engine relays it; the consumer answers with report_background (#122), mirroring ColorSchemeQuery.

§

MarkerDisposed(MarkerId)

A decoration marker’s line left the buffer — evicted past the scrollback cap, or scrolled out of an in-screen region (#118). The handle is now dead; the consumer drops the decoration bound to it. This is the frame-mode equivalent of xterm’s IMarker.onDispose — disposal is a point-in-time fact (a marker absent from a frame may merely be scrolled off-screen), so it rides the event queue, not the frame overlay.

§

MarkerCreated

A marker was created (#490) — by add_marker, or by the stream through an OSC 133 command mark, which the consumer never called for.

The mirror of TermEvent::MarkerDisposed, and it exists for the same reason ADR-0020 R1 gives: an appearance is an occurrence, not state, so it rides this queue rather than a frame field. Without it a consumer that pulled a marker index (Engine::marker_index) has no way to learn of a marker born after its pull — the population would only ever shrink.

line is absolute at the moment of creation, on the same basis the pull reports (Frame::evicted_total), so a consumer appends the entry and rebases it exactly like a pulled one. Deliberately not an epoch bump: a bump costs a whole re-pull, and creation is O(1) information.

Fields

§line: u32

Trait Implementations§

Source§

impl Clone for TermEvent

Source§

fn clone(&self) -> TermEvent

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 TermEvent

Source§

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

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

impl Eq for TermEvent

Source§

impl PartialEq for TermEvent

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for TermEvent

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.