Expand description
Terminal graphics capability + cell-pixel-size detection. The response
PARSERS here are pure and unit-tested; the I/O round-trip in detect is
verified manually (no PTY tests, per project policy).
Structs§
- Term
Graphics - What the terminal supports, plus its cell pixel size when reported.
Functions§
- detect
- Probe the terminal for graphics support. Writes the query sequences to
/dev/tty, reads the response with a short deadline, and parses it. Falls back to environment heuristics when the round-trip yields nothing. Pure ASCII (no support) is represented by an all-falseTermGraphics. - env_
fallback - Best-effort capability guess from environment variables, used when the active query times out (e.g. inside some terminal multiplexers).
- parse_
responses - Parse a batch of terminal query responses (raw bytes) into capabilities.
Looks for: Kitty
ESC _ G ... ; OK ESC \, a DA1ESC [ ? <attrs> cwhose attribute list contains4(Sixel), and a cell-size reportESC [ 6 ; <h> ; <w> t.