Skip to main content

Module detect

Module detect 

Source
Expand description

Feature detection from the program side, as a pure state machine.

The spec’s recipe: send the query OSC 7501 ; ? ST and right after it primary device attributes (CSI c). Every terminal answers DA1, so if its reply arrives without a 7501 reply before it, the protocol is unsupported. A supporting terminal’s reply arrives first.

Detector does no I/O: write QUERY to the terminal (in raw mode), feed whatever comes back to Detector::feed until it returns an Outcome, or call Detector::finish when your timeout expires. It keeps reading until the DA1 reply so neither reply leaks into the shell afterwards.

Structs§

Detector
Interprets the terminal’s replies. See the module docs.

Enums§

Outcome
The result of detection.

Constants§

QUERY
The bytes to write: the OSC 7501 query followed by CSI c.