Expand description
Canonical terminal capability probe.
VT Code paints box-drawing chrome in more than one surface (the CLI transcript, the TUI panels, the modal lists) and each surface used to answer “can this terminal draw Unicode?” on its own. Those answers disagreed, so the same machine could render Unicode chrome in one surface and ASCII chrome in another.
This module owns the single answer: one probe, one verdict, evaluated once per process. The verdict is a deterministic fallback ladder:
VTCODE_NO_UNICODEset to an affirmative value drops straight to ASCII.- A terminal that advertises Unicode (
TERM), or a UTF-8 locale, earns Unicode box drawing. - A terminal known to render the dashed box-drawing variants correctly earns the rich tier.
- Everything else stays on ASCII, which never renders as mojibake.
The probe never guesses from the terminal name alone: iTerm2, WezTerm,
and Hyper all advertise TERM=xterm-256color, so TERM_PROGRAM is the
signal that identifies them.
Structs§
- Terminal
Env - Terminal environment inputs the capability probe reads.
Enums§
- BoxGlyph
Tier - Richness of the box-drawing chrome the terminal can render.
Functions§
- box_
glyph_ tier - Whether the environment advertises Unicode box-drawing support.
- box_
glyph_ tier_ for - Evaluate the capability ladder against a captured environment.