DA1
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
DA1 (Primary Device Attributes) is a CSI sequence that queries the terminal for its identity and supported features. The terminal responds with a list of attribute codes.
Syntax
CSI c DA1 request (query)
CSI ? Pp ; ... c DA1 response
Formal syntax
(* Request *)
DA1-request = 0x1b, "[", [ "0" ], "c" ;
(* Response *)
DA1-response = 0x1b, "[", "?", Pp, { ";", Ps }, "c" ;
Pp = digit, { digit } ; (* terminal type *)
Ps = digit, { digit } ; (* feature code *)
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 the terminal's primary device attributes. The terminal responds with CSI ? Pp ; Ps ; ... c where Pp identifies the terminal type and the Ps values indicate supported features.
Common response types
The leading Pp value identifies the terminal class:
| Value | Terminal type |
|---|---|
1 | VT100 |
6 | VT102 |
62 | VT220 |
63 | VT320 |
64 | VT420 |
65 | VT510/VT520 |
Feature codes
Common Ps feature attribute values include:
| Code | Feature |
|---|---|
1 | 132 columns |
4 | Sixel graphics |
6 | Selective erase |
9 | National Replacement Character sets |
15 | Technical character set |
22 | ANSI color (VT525) |
Most modern terminal emulators respond as a VT220 (?62) or higher with various feature flags. The exact response varies by terminal and is a common method for feature detection.
Examples
# Send DA1 query and read response
printf '\e[c'
# Typical XTerm response: ESC[?62;4;6;22c
Specifications
| Specification | Section |
|---|---|
| VT510 Reference | — |
Terminal support
| Terminal | Support | Version | Notes |
|---|---|---|---|
| Terminal Emulators | |||
| Alacritty | ✓ | Yes | Reports VT102 (ESC [?6c) |
| Bobcat | ✓ | 0.9.0 | Supported via TerminalCtrl library; device ID set as 'Bobcat <version>' (Terminal.cpp:35) |
| contour | ✓ | v0.1.0 | |
| foot | ✓ | Yes | Implemented at csi.c:822-875, reports as VT220 with sixel and color support |
| Ghostty | ✓ | v1.0.0 | |
| iTerm2 | ✓ | Yes | Primary device attributes (DA1) fully implemented with VT100CSI_DA token type. Reports various capabilities based on terminal type and emulation level. |
| Kitty | ✓ | Yes | Responds with callback to on_da1 |
| Konsole | ✓ | Yes | Reports VT220 with capabilities via CSI ? 62 ; 1 ; 4 c |
| mintty | ✓ | Yes | Implemented in write_primary_da() at src/termout.c:880. Reports different DA strings based on terminal type configuration (vt100-vt500). |
| mlterm | ✓ | Yes | Supported since early versions, customizable via primary_da config |
| PuTTY | ✓ | 0.43 | Primary DA (CSI c) returns VT102 response at terminal.c:4509-4515 |
| Rio | ✓ | v0.0.3 | Reports VT220 with ANSI color, VT320 rectangles, and user windows |
| rxvt-unicode | ✓ | 1.2 | Reports VT100_ANS: ESC[?1;2c |
| st | ✓ | 0.3 | Responds with VT102 identity (vtiden configurable) |
| terminology | ✓ | v0.4.0 | Reports VT510 with sixel, selective erase, color support |
| VT100 | ✓ | Yes | |
| VTE | ✓ | Yes | Supports VT520 level with 132-column mode, sixel graphics (conditional), horizontal scrolling, color text, and rectangular editing |
| WezTerm | ✓ | Yes | RequestPrimaryDeviceAttributes returns VT500 with capabilities |
| Windows Terminal | ✓ | Yes | Reports conformance level 61 with extensions 4,6,7,14,21,22,23,24,28,32,42,52 |
| xterm | ✓ | Yes | VT100 feature, supported since earliest versions |
| xterm.js | ✓ | 2.3.0 | |
| Multiplexers | |||
| cy | ✓ | v0.1.0 | Responds with CSI ?6c |
| GNU Screen | ✓ | v.4.2.0 | CSI c reports VT100 with parameters 1;2 at src/ansi.c:1041-1043 |
| tmux | ✓ | 1.3 | Responds with VT220 attributes; Sixel support (4) included if compiled with ENABLE_SIXEL |
| tuios | ✓ | v0.0.15 | Reports VT220 with 132 columns, selective erase, national replacement charset, technical characters, windowing capability, and ANSI color |
| Zellij | ✓ | v0.12.0 | Reports VT220 with Sixel support (ESC[?62;4c) |
See also
- DA2 — Secondary Device Attributes — Terminal version information
- DA3 — Tertiary Device Attributes — Terminal unit ID
- DSR/CPR — Device Status Report — Query device status