Skip to main content

capabilities

Function capabilities 

Source
pub fn capabilities() -> Capabilities
Available on crate feature crossterm only.
Expand description

Runtime terminal capability probe (issue #264): read-only Capabilities snapshot plus the Blitter ladder it drives. Diagnostics-only — image rendering routes through the ladder automatically. Return the process-global negotiated Capabilities, probing the terminal exactly once on first call and caching the result.

On an identified direct terminal, the probe issues DA1 (CSI c), DA2 (CSI > c), and XTGETTCAP for the truecolor capname, reading replies through the existing OSC round-trip infrastructure with a bounded total timeout (≤180ms). Generic PTY wrappers, TERM=dumb, and tmux/screen skip automatic queries to avoid leaking control bytes or racing user input; environment-based fallbacks remain available. Set SLT_FORCE_TERMINAL_QUERIES=1 to opt in or SLT_DISABLE_TERMINAL_QUERIES=1 to disable all terminal queries. Repeated calls are free.