Skip to main content
ansicode

DA — Device Attributes (CSI c / CSI > c)

Ask the terminal what kind of VT it is — primary (CSI c) returns features, secondary (CSI > c) returns model + firmware.

Byte forms

Every common string-literal form so you can paste-and-search either direction.

\\x1b[\x1b[c (primary DA) \x1b[>c (secondary DA)
\\033[\033[c / \033[>c
\\e[\e[c / \e[>c
ESC [ESC [ c / ESC [ > c
hex1b 5b 63 / 1b 5b 3e 63

Description

Device Attributes — a request/reply pair the application sends and the terminal answers via the input stream. **Primary DA** (`\x1b[c`, sometimes `\x1b[0c`) — terminal replies with `\x1b[?64;...c` listing the VT class and supported optional features (132-column mode, sixel, ReGIS, user-defined keys, etc.). **Secondary DA** (`\x1b[>c`, sometimes `\x1b[>0c`) — terminal replies with `\x1b[>Pp;Pv;Pcc` where Pp is the model (`0`=VT100, `1`=VT220, `41`=VT420, `61`=xterm-style, `65`=VT525, etc.), Pv is the firmware version, Pcc is the ROM cart serial (usually 0). Apps use DA on startup to feature-detect — neovim's `t_Co` autodetect, tmux's title-set capability probing, mintty's xterm-compat checks all rely on it.

Spec citation: ECMA-48 §8.3.24 (DA) / xterm-ctlseqs

Examples

bash
# Send primary DA and read the reply (raw mode):\nstty -echo raw min 0 time 5\nprintf '\033[c'; IFS= read -r -t 1 -d c REPLY; stty sane\necho "DA reply: $REPLY c"
python
import sys, termios, tty, select\nfd = sys.stdin.fileno(); old = termios.tcgetattr(fd); tty.setraw(fd)\ntry:\n    sys.stdout.write('\x1b[c'); sys.stdout.flush()\n    r, _, _ = select.select([fd], [], [], 1.0)\n    print(repr(sys.stdin.read(64)) if r else 'no reply')\nfinally:\n    termios.tcsetattr(fd, termios.TCSADRAIN, old)
go
fmt.Print("\x1b[c")   // request; read reply via os.Stdin in raw mode
javascript
process.stdout.write('\x1b[c')   // reply arrives on process.stdin
c
printf("\x1b[c"); fflush(stdout); /* read reply from stdin */

Terminal support

xterm
yes
Linux console (fbcon)
yes
macOS Terminal.app
yes
iTerm2
yes
Windows Terminal
yes
cmd.exe / ConPTY
partial
kitty
yes
alacritty
yes
WezTerm
yes
Ghostty
yes
GNOME Terminal
yes
Konsole
yes
tmux
no
GNU screen
no

Related sequences

In the family cookbook

CSI cookbook · 4. Queries — DA, DA2, DSR, DECRQM