pub struct EnvView {
pub is_stdout_tty: bool,
pub no_color: bool,
pub term: Option<String>,
pub colorterm: Option<String>,
pub force_ascii: bool,
pub force_unicode: bool,
pub lang: Option<String>,
pub lc_all: Option<String>,
pub is_windows: bool,
pub wt_session: Option<String>,
pub term_program: Option<String>,
}Expand description
All environment signals we care about for rendering decisions.
Default returns the safest non-TTY-ish snapshot (no special env
vars, no UTF-8 hint, not Windows). Tests use it via ..Default::default()
so adding a new field doesn’t require touching every fixture; production
code goes through EnvView::probe.
Fields§
§is_stdout_tty: bool§no_color: bool§term: Option<String>§colorterm: Option<String>§force_ascii: boolSet when the user has explicitly asked for ASCII-only rendering
(e.g. ATOMCODE_ASCII=1). Escape hatch for terminals whose font
can’t render our Unicode prompt glyphs (❯, ◆, etc.) and
would otherwise show □ tofu.
force_unicode: boolSet when the user has explicitly opted INTO Unicode rendering
(ATOMCODE_UNICODE=1) — overrides the Windows-legacy-console
auto-fallback for users who installed a font that does have the
glyphs (Cascadia Code, JetBrains Mono, etc.) on plain conhost.
lang: Option<String>§lc_all: Option<String>§is_windows: booltrue when running on Windows. Affects the default-Unicode
decision because the legacy conhost host pairs with fonts
(Consolas, NSimSun, …) that don’t include ◐, ❯, etc.
wt_session: Option<String>WT_SESSION — set by Windows Terminal. Strong signal that the
terminal has a modern font with broad Unicode coverage.
term_program: Option<String>TERM_PROGRAM — set by VS Code, iTerm2, WezTerm, Hyper, etc.
Any value here means the user is on a modern emulator that
almost certainly ships a Unicode-capable default font.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for EnvView
impl RefUnwindSafe for EnvView
impl Send for EnvView
impl Sync for EnvView
impl Unpin for EnvView
impl UnsafeUnpin for EnvView
impl UnwindSafe for EnvView
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more