pub struct GraphicsEnvironment {
pub graphics: Field<Graphics>,
pub sixel: Field<bool>,
pub cell_pixels: Field<Option<CellPixels>>,
pub interactive: bool,
pub color: ColorDepth,
pub unicode: bool,
pub animation: Field<bool>,
}Expand description
What the terminal can draw beyond text, with where each answer came
from: the ext-side environment micro-asset renderers read (core’s
TargetCapabilities is left as upstream has it).
Fields§
§graphics: Field<Graphics>The graphics protocol found (or overridden).
sixel: Field<bool>Whether Sixel was found, separately (WezTerm speaks both).
cell_pixels: Field<Option<CellPixels>>The size of one cell in pixels, when the terminal said.
interactive: boolstdout is a terminal.
color: ColorDepthColour depth, for block renderings.
unicode: boolWhether emoji and block characters can be shown.
animation: Field<bool>Whether animation may run (off with reduced motion or
RICH_ANIMATION=0).
Implementations§
Source§impl GraphicsEnvironment
impl GraphicsEnvironment
Sourcepub fn from_report(
report: &Report,
env: &dyn Environment,
) -> GraphicsEnvironment
pub fn from_report( report: &Report, env: &dyn Environment, ) -> GraphicsEnvironment
From a capability report, reading the cell size from env: the
RICH_CELL_PIXELS=WxH override, then the terminal’s window size in
pixels. Never queries the terminal.
Sourcepub fn detect(env: &dyn Environment) -> GraphicsEnvironment
pub fn detect(env: &dyn Environment) -> GraphicsEnvironment
Detect from env, never querying the terminal.
Sourcepub fn system() -> GraphicsEnvironment
pub fn system() -> GraphicsEnvironment
Detect from the process. When the cell size is still unknown and both
stdin and stdout are a terminal, ask the terminal (CSI 16 t,
waiting at most 500 ms) — from the foreground only, and only when no
input is waiting (query_cell_pixels). Every terminal answers the
device-attributes request sent with it, which ends the wait at once,
so the timeout only bounds a terminal that answers nothing; a shorter
one let a reply over a slow link arrive late, as typed input.
Trait Implementations§
Source§impl Clone for GraphicsEnvironment
impl Clone for GraphicsEnvironment
Source§impl Debug for GraphicsEnvironment
impl Debug for GraphicsEnvironment
impl Eq for GraphicsEnvironment
Source§impl PartialEq for GraphicsEnvironment
impl PartialEq for GraphicsEnvironment
Source§impl Serialize for GraphicsEnvironment
impl Serialize for GraphicsEnvironment
impl StructuralPartialEq for GraphicsEnvironment
Auto Trait Implementations§
impl Freeze for GraphicsEnvironment
impl RefUnwindSafe for GraphicsEnvironment
impl Send for GraphicsEnvironment
impl Sync for GraphicsEnvironment
impl Unpin for GraphicsEnvironment
impl UnsafeUnpin for GraphicsEnvironment
impl UnwindSafe for GraphicsEnvironment
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.