DA2
AI-Generated Content
This page was generated with the assistance of AI and may contain inaccuracies. It is intended as a placeholder for future human verification. If you spot issues ahead of its initial review, please report them on GitHub!
Standard
DA2 (Secondary Device Attributes) is a CSI sequence that queries the terminal for its type and firmware version.
Syntax
CSI > c DA2 request (query)
CSI > Pp ; Pv ; Pc c DA2 response
Formal syntax
(* Request *)
DA2-request = 0x1b, "[", ">", [ "0" ], "c" ;
(* Response *)
DA2-response = 0x1b, "[", ">", Pp, ";", Pv, ";", Pc, "c" ;
Pp = digit, { digit } ; (* terminal type *)
Pv = digit, { digit } ; (* firmware version *)
Pc = digit, { digit } ; (* ROM cartridge / always 0 *)
digit = "0" | "1" | "2" | "3" | "4"
| "5" | "6" | "7" | "8" | "9" ;Description
Per the VT510 manual, the host sends CSI > c (or CSI > 0 c) to request secondary device attributes. The response contains three values:
Pp— Terminal type identifierPv— Firmware/software version numberPc— ROM cartridge registration number (always 0 on modern terminals)
Common terminal type identifiers
| Value | Terminal |
|---|---|
0 | VT100 |
1 | VT220 |
2 | VT240 / VT241 |
41 | XTerm (commonly used) |
65 | VT510 / VT520 |
Modern terminal emulators report different values. For example, XTerm reports 41 for Pp and its patch level for Pv. Some terminals (e.g., iTerm2, kitty) use unique identifiers.
note
DA2 is commonly used for terminal identification in conjunction with DA1. However, relying on DA2 for feature detection is fragile since terminals may report any values they choose. The XTVERSION query or DECRQM are more reliable for specific feature detection.
Examples
printf '\e[>c'
# Typical XTerm response: ESC[>41;351;0c
Specifications
| Specification | Section |
|---|---|
| VT510 Reference | — |
Terminal support
| Terminal | Support | Version | Notes |
|---|---|---|---|
| Terminal Emulators | |||
| Alacritty | ✓ | v0.6.0 | |
| Bobcat | ✓ | 0.9.0 | Supported via TerminalCtrl library |
| contour | ✓ | v0.1.0 | |
| foot | ✓ | Yes | Implemented at csi.c:1627-1667, reports VT220 with version number |
| Ghostty | ✓ | v1.0.0 | |
| iTerm2 | ✓ | Yes | Secondary device attributes (DA2) fully implemented with VT100CSI_DA2 token type. Reports terminal version via reportSecondaryDeviceAttribute method. |
| Kitty | ✓ | Yes | Responds with >1;PRIMARY_VERSION;SECONDARY_VERSION c |
| Konsole | ✓ | Yes | Reports secondary attributes via CSI > 1 ; 115 ; 0 c |
| mintty | ✓ | Yes | Implemented at src/termout.c:3137-3143. Reports terminal ID 77 (mintty), decimal version, and Unicode version. |
| mlterm | ✓ | Yes | Supported since early versions, customizable via secondary_da config |
| PuTTY | ✓ | 0.52 | Secondary DA (CSI > c) reports xterm version 136 at terminal.c:4387-4394 |
| Rio | ✓ | v0.0.3 | |
| rxvt-unicode | ✓ | 1.2 | Reports CSI > 85;95;0c where 85='U' for urxvt |
| st | ✗ | No | CSI > c not handled; only ? prefix supported in parser |
| terminology | ✓ | v0.4.0 | Reports as VT510 terminal (61) |
| VT100 | ✗ | No | |
| VTE | ✓ | Yes | Reports as VT100-ish (level 1) or VT525 (level 5) depending on build configuration |
| WezTerm | ✓ | Yes | RequestSecondaryDeviceAttributes returns VT220 with version 277 |
| Windows Terminal | ✓ | Yes | Reports VT100 terminal type (0) with version 10 (1.0) |
| xterm | ✓ | Yes | VT220+ feature, extended to VT100 in xterm |
| xterm.js | ✓ | 2.3.0 | |
| Multiplexers | |||
| cy | ✗ | No | |
| GNU Screen | ✓ | v.4.2.0 | CSI > c reports terminal type 83 (ASCII 'S') at src/ansi.c:1194-1196 |
| tmux | ✓ | 1.3 | Responds with terminal type 84 (tmux) |
| tuios | ✓ | v0.0.15 | Reports VT220 version 1.0 |
| Zellij | ✓ | v0.12.0 | Reports secondary device attributes with version number |
See also
- DA1 — Primary Device Attributes — Terminal class and features
- DA3 — Tertiary Device Attributes — Terminal unit ID