如何解读vt-100 / vt-102 DA请求的响应

2024-05-13 20:22:24 发布

您现在位置:Python中文网/ 问答频道 /正文

如何解释DA转义序列(\e[c)的响应?在

在urxvt中运行命令时,我得到1;2,在linux控制台(和st)中我得到6;,在xterm中得到64;1;2;6;9;15;18;21;22。在

根据我在互联网上找到的信息,这些字符串应该以某种方式识别终端的功能。http://www.vt100.net/docs/vt100-ug/chapter3.html#DA

No options                  ESC [?1;0c
Processor option (STP)      ESC [?1;1c
Advanced video option (AVO) ESC [?1;2c
AVO and STP                 ESC [?1;3c
Graphics option (GPO)       ESC [?1;4c
GPO and STP                 ESC [?1;5c
GPO and AVO                 ESC [?1;6c
GPO, STP and AVO            ESC [?1;7c

这似乎符合urxvt(可能还有xterm)的响应,但其他人的响应却不一致。所有提到的终端似乎都相当兼容VT-102,据我所知,这将映射到1;2(AVO)。在

有谁知道?在


Tags: and命令终端linuxurxvtdaoptionst
2条回答

xterm响应的文档可以在XTerm Control Sequences中找到

请注意,对于所有的X窗口应用程序,都有一个资源可以将响应更改为您想要的任何响应。。在

       
CSI Ps c  Send Device Attributes (Primary DA).
            Ps = 0  or omitted ⇒  request attributes from terminal.  The
          response depends on the decTerminalID resource setting.
            ⇒  CSI ? 1 ; 2 c  ("VT100 with Advanced Video Option")
            ⇒  CSI ? 1 ; 0 c  ("VT101 with No Options")
            ⇒  CSI ? 6 c  ("VT102")
            ⇒  CSI ? 6 2 ; Psc  ("VT220")
            ⇒  CSI ? 6 3 ; Psc  ("VT320")
            ⇒  CSI ? 6 4 ; Psc  ("VT420")

          The VT100-style response parameters do not mean anything by
          themselves.  VT220 (and higher) parameters do, telling the
          host what features the terminal supports:
            Ps = 1  ⇒  132-columns.
            Ps = 2  ⇒  Printer.
            Ps = 3  ⇒  ReGIS graphics.
            Ps = 4  ⇒  Sixel graphics.
            Ps = 6  ⇒  Selective erase.
            Ps = 8  ⇒  User-defined keys.
            Ps = 9  ⇒  National Replacement Character sets.
            Ps = 1 5  ⇒  Technical characters.
            Ps = 1 6  ⇒  Locator port.
            Ps = 1 7  ⇒  Terminal state interrogation.
            Ps = 1 8  ⇒  User windows.
            Ps = 2 1  ⇒  Horizontal scrolling.
            Ps = 2 2  ⇒  ANSI color, e.g., VT525.
            Ps = 2 8  ⇒  Rectangular editing.
            Ps = 2 9  ⇒  ANSI text locator (i.e., DEC Locator mode).
xt locator (i.e., DEC Locator mode)

我的WAG一些模拟器没有完全/正确地实现这一点,所以如果你依赖它,你需要根据具体情况。在

根据VT100.net,64表示VT-420的能力:

VT420 DA* CSI ? 64; 1; 2; 6; 7; 8; 9; 15; 18; 19; 21 c VT420 terminal

但是,正如george所指出的,在一天中黑客攻击了一些termcap条目,即使是单个终端类型在回答查询时的回答也几乎没有一致性。在

在那个网站上有大量的信息,所有这些都应该被作者认为是“最大的努力”,因为“权威”真的无法实现。在

相关问题 更多 >