CSI DA — Device Attributes (primary / secondary / tertiary)
DA queries the terminal's identity. Primary DA (CSI c or CSI 0 c, final 'c') asks what the terminal is; the reply CSI ? ... c lists a model class and feature codes. Secondary DA (CSI > c) reports terminal type, firmware version, and ROM cartridge as CSI > Pp ; Pv ; Pc c. Tertiary DA (CSI = c) requests a unit ID, replied via a DCS string (DECRPTUI).
aka: DA · DA1 · DA2 · DA3 · device attributes · primary DA · secondary DA · ESC [ c · ESC [ > c
frame
CSI introducer: \x1b[ESC [ (0x1B 0x5B)
terminator (none): ST · BEL
parameters / subcommands
id
name
bytes (ST)
meaning
primary
Primary DA (DA1) — CSI c
\x1b[c
CSI c (or CSI 0 c) asks the terminal to identify its class and features. A VT100-class terminal replies e.g. CSI ? 1 ; 2 c; an xterm-class one CSI ? 6 2 ; ... c (62 = VT220 level, followed by feature numbers).
secondary
Secondary DA (DA2) — CSI > c
\x1b[>c
CSI > c reports terminal type, firmware version, and ROM cartridge: reply CSI > Pp ; Pv ; Pc c (e.g. Pp identifies the model, Pv the version).
tertiary
Tertiary DA (DA3) — CSI = c
\x1b[=c
CSI = c requests a unit ID; the terminal replies with a DCS report (DECRPTUI), DCS ! | <hex id> ST.
gotchas
The DA reply arrives on the terminal's INPUT stream; read with a timeout to avoid blocking.
Primary DA is the most-used handshake: emulators report a VT220/VT320-class set of feature codes that programs use to gate capabilities. Do NOT assume a specific code list — parse defensively.
Secondary DA's 'version' field is emulator-defined (e.g. xterm reports its patch number); it is not a reliable real-firmware version.
Tertiary DA replies via a DCS (Device Control String), not a CSI, so a CSI-only parser will miss it.
CSI c with no parameter equals CSI 0 c (primary DA).
#summary — https://invisible-island.net/xterm/ctlseqs/ctlseqs.htmlxterm ctlseqs: CSI Ps c = Send Device Attributes (Primary DA); CSI > Ps c = Secondary DA (reports type;version;cartridge); CSI = Ps c = Tertiary DA (DECRPTUI unit id). Primary reply CSI ? 6 1/6 2/... ; ... c.
ext.params — https://vt100.net/docs/vt510-rm/DA1.htmlDEC VT510 manual: Primary DA (CSI c) reports the terminal's service class and supported features; Secondary DA (CSI > c) reports identification code, firmware version, and ROM cartridge.