Terminal capability detection via escape sequence queries.
Provides a Capabilities struct that records what the terminal supports. Capabilities come from terminal query responses (async, within a 100ms window).
Query-based capabilities start as :unknown and are upgraded to true/false
as responses arrive. Accessor functions resolve :unknown → false at read time,
so there is no separate finalization step. Late responses can still upgrade a
capability at any time.
This struct is observational — it records capabilities but does not gate output. Conditional output gating (e.g., skipping ANSI for TERM=dumb) is a separate concern.
Summary
Functions
Apply a parsed capability response event to the capabilities struct.
Initial capabilities before any terminal query response arrives.
Does the terminal support synchronized output (mode 2026)? Resolves :unknown → false.
Types
Functions
Apply a parsed capability response event to the capabilities struct.
Capability events have %{type: :capability, capability: atom(), ...} with
additional keys varying by capability type:
:kitty_keyboard—value: flags(integer):decrqm—mode: integer, status: integer
Can be called at any time, including after the detection window closes. Late responses simply update the struct.
@spec detect_env() :: t()
Initial capabilities before any terminal query response arrives.
Does the terminal support synchronized output (mode 2026)? Resolves :unknown → false.