pub struct TerminalEnv {
pub term: Option<String>,
pub term_program: Option<String>,
pub lang: Option<String>,
pub lc_all: Option<String>,
pub lc_ctype: Option<String>,
pub no_unicode: Option<String>,
pub no_rich_unicode: Option<String>,
}Expand description
Terminal environment inputs the capability probe reads.
The verdict is a pure function of this snapshot, so callers that need to evaluate a hypothetical environment can do so without mutating the process environment.
Fields§
§term: Option<String>TERM — the terminal’s generic capability string.
term_program: Option<String>TERM_PROGRAM — the terminal program’s own name.
lang: Option<String>LANG — the primary locale.
lc_all: Option<String>LC_ALL — the locale override.
lc_ctype: Option<String>LC_CTYPE — the character-encoding locale.
no_unicode: Option<String>VTCODE_NO_UNICODE — opt out of Unicode chrome.
no_rich_unicode: Option<String>VTCODE_NO_RICH_UNICODE — opt out of the dashed box-drawing variants.
Implementations§
Source§impl TerminalEnv
impl TerminalEnv
Sourcepub fn no_unicode_requested(&self) -> bool
pub fn no_unicode_requested(&self) -> bool
Whether the user asked for ASCII-only chrome.
Uses the repository’s canonical env-flag semantics: only an affirmative
value (1, true, yes, on, debug) disables Unicode, so
VTCODE_NO_UNICODE=0 leaves Unicode chrome enabled.
Sourcepub fn no_rich_unicode_requested(&self) -> bool
pub fn no_rich_unicode_requested(&self) -> bool
Whether the user asked to skip the dashed box-drawing variants.
Sourcepub fn supports_unicode_box_drawing(&self) -> bool
pub fn supports_unicode_box_drawing(&self) -> bool
Whether the terminal can draw Unicode box-drawing glyphs.
TERM is authoritative because it describes the terminal program; the
locale only decides the question when TERM says nothing. A UTF-8
locale is the only positive evidence left, so without one the answer
stays at “no” and the terminal keeps ASCII chrome.
Sourcepub fn supports_rich_box_drawing(&self) -> bool
pub fn supports_rich_box_drawing(&self) -> bool
Whether the terminal renders the dashed box-drawing variants correctly.
TERM_PROGRAM identifies the terminal program; TERM only names it
for the terminals that put their name in TERM as well.
Trait Implementations§
Source§impl Clone for TerminalEnv
impl Clone for TerminalEnv
Source§impl Debug for TerminalEnv
impl Debug for TerminalEnv
Source§impl Default for TerminalEnv
impl Default for TerminalEnv
impl Eq for TerminalEnv
Source§impl PartialEq for TerminalEnv
impl PartialEq for TerminalEnv
impl StructuralPartialEq for TerminalEnv
Auto Trait Implementations§
impl Forget for TerminalEnv
impl Freeze for TerminalEnv
impl Move for TerminalEnv
impl RefUnwindSafe for TerminalEnv
impl Send for TerminalEnv
impl Sync for TerminalEnv
impl Unpin for TerminalEnv
impl UnsafeUnpin for TerminalEnv
impl UnwindSafe for TerminalEnv
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.