No support for xterm Send Device Attributes (Secondary DA) control sequence #8057

Open
opened 2026-01-31 01:19:42 +00:00 by claunia · 0 comments
Owner

Originally created by @zrait on GitHub (May 11, 2020).

Environment

Windows build number: [Version 10.0.19041.208]
Windows Terminal version (if applicable): 0.11.1251.0

Steps to reproduce

echo -e '\e[>c'

Expected behavior

A secondary device attribute response providing information that better describes what capabilities Windows Terminal actually supports.

Excerpt from xterm ctl sequences:

CSI > Ps c
          Send Device Attributes (Secondary DA).
            Ps = 0  or omitted ⇒  request the terminal's identification
          code.  The response depends on the decTerminalID resource set-
          ting.  It should apply only to VT220 and up, but xterm extends
          this to VT100.
            ⇒  CSI  > Pp ; Pv ; Pc c
          where Pp denotes the terminal type
            Pp = 0  ⇒  "VT100".
            Pp = 1  ⇒  "VT220".
            Pp = 2  ⇒  "VT240" or "VT241".
            Pp = 1 8  ⇒  "VT330".
            Pp = 1 9  ⇒  "VT340".
            Pp = 2 4  ⇒  "VT320".
            Pp = 3 2  ⇒  "VT382".
            Pp = 4 1  ⇒  "VT420".
            Pp = 6 1  ⇒  "VT510".
            Pp = 6 4  ⇒  "VT520".
            Pp = 6 5  ⇒  "VT525".

          and Pv is the firmware version (for xterm, this was originally
          the XFree86 patch number, starting with 95).  In a DEC termi-
          nal, Pc indicates the ROM cartridge registration number and is
          always zero.

Actual behavior

No response to control sequence

Why this matters right now?

When Windows Terminal sets TERM to be xterm-256color, certain popular applications expect it to respond to xterm control sequences. I came across this issue (and suspect many others have as well, although it's surprising to me that I didn't see an existing issue for it) because Emacs was hanging for 2 seconds on load whenever being launched inside Windows Terminal due to code in xterm.el (see here) (part of its terminal-capability-determination startup code) that queries the capabilities of xterm using the Secondary Device Attribute control sequence. Other terminals that masquerade as xterm (such as iTerm2, OS X's Terminal, and gnome-terminal) respond to this query.

Originally created by @zrait on GitHub (May 11, 2020). # Environment Windows build number: [Version 10.0.19041.208] Windows Terminal version (if applicable): 0.11.1251.0 # Steps to reproduce `echo -e '\e[>c'` # Expected behavior A secondary device attribute response providing information that better describes what capabilities Windows Terminal actually supports. Excerpt from [xterm ctl sequences](https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Functions-using-CSI-_-ordered-by-the-final-character_s_): ``` CSI > Ps c Send Device Attributes (Secondary DA). Ps = 0 or omitted ⇒ request the terminal's identification code. The response depends on the decTerminalID resource set- ting. It should apply only to VT220 and up, but xterm extends this to VT100. ⇒ CSI > Pp ; Pv ; Pc c where Pp denotes the terminal type Pp = 0 ⇒ "VT100". Pp = 1 ⇒ "VT220". Pp = 2 ⇒ "VT240" or "VT241". Pp = 1 8 ⇒ "VT330". Pp = 1 9 ⇒ "VT340". Pp = 2 4 ⇒ "VT320". Pp = 3 2 ⇒ "VT382". Pp = 4 1 ⇒ "VT420". Pp = 6 1 ⇒ "VT510". Pp = 6 4 ⇒ "VT520". Pp = 6 5 ⇒ "VT525". and Pv is the firmware version (for xterm, this was originally the XFree86 patch number, starting with 95). In a DEC termi- nal, Pc indicates the ROM cartridge registration number and is always zero. ``` # Actual behavior No response to control sequence # Why this matters right now? When Windows Terminal sets `TERM` to be `xterm-256color`, certain popular applications expect it to respond to xterm control sequences. I came across this issue (and suspect many others have as well, although it's surprising to me that I didn't see an existing issue for it) because Emacs was hanging for 2 seconds on load whenever being launched inside Windows Terminal due to code in `xterm.el` ([see here](https://github.com/emacs-mirror/emacs/blob/master/lisp/term/xterm.el#L704)) (part of its terminal-capability-determination startup code) that queries the capabilities of xterm using the Secondary Device Attribute control sequence. Other terminals that masquerade as xterm (such as iTerm2, OS X's Terminal, and gnome-terminal) respond to this query.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#8057