更改

跳到导航 跳到搜索

ANSI转义序列

删除180字节2019年9月28日 (六) 14:32
转义序列
! 序列 !! C1 !! 名称 !! 作用
|- id=SS2
| {{nobr|ESC N}} || 0x8e || {{nobr|SS2 – Single Shift Two}} || rowspan=2 | 从其中一个替代字符集中选择一个字符。在xterm中,SS2选择G2字符集,SS3选择G3字符集。<ref name="xtc"/>
|- id=SS3
| {{nobr|ESC O}} || 0x8f || {{nobr|SS3 – Single Shift Three}}
|- id=DCS
| {{nobr|ESC P}} || 0x90 || {{nobr|DCS – 设备控制字符串(Device Control String)}} || 控制设备。在xterm中,这个序列的使用包括定义用户自定义的密钥,以及请求或设置Termcap/Terminfo数据。<ref name="xtc"/>
|- id=CSI
| {{nobr|ESC [}} || 0x9b || {{nobr|CSI - 控制序列导入器(Control Sequence Introducer)}} || 大部分有用的序列,请参阅下一节。结束于ASCII 64到126 (<code>@</code>到<code>~</code>/十六进制0x40到0x7E).<ref name="ecma48"/>
|- id=ST
| {{nobr|ESC \}} || 0x9c || {{nobr|ST – 字符串终止(String Terminator)}} || 终止其他控件(包括APC,DCS,OSC,PM和SOS)中的字符串。<ref name="ecma48">{{cite web |url=http://www.ecma-international.org/publications/standards/Ecma-048.htm |title=Standard ECMA-48: Control Functions for Coded Character Sets |edition=Fifth |date=June 1991 |institution=[[Ecma International]]}}</ref>{{Rp|8.3.143}}
|- id=OSC
| {{nobr|ESC ]}} || 0x9d || {{nobr|OSC – 操作系统命令(Operating System Command)}} || 启动操作系统使用的控制字符串。OSC序列与CSI序列相似,但不限于整数参数。通常,这些控制序列由ST终止<ref name="ecma48"/>{{Rp|8.3.89}}。在xterm中,它们也可能被BEL终止<ref name="xtc"/>。例如,在xterm中,窗口标题可以这样设置:<code>OSC 0;this is the window title BEL</code>。
|- id=SOS
| {{nobr|ESC X}} || 0x98 || {{nobr|SOS – 字符串开始(Start of String)}} || rowspan=3 | 引用由ST终止的一串文本的参数。这些字符串控制序列的用途由应用程序<ref name="ecma48"/>{{Rp|8.3.2,8.3.128}}或私有规则来定义<ref name="ecma48"/>{{Rp|8.3.94}}。这些函数没有实现,参数被xterm忽略<ref name="xtc"/>。
|- id=PM
| {{nobr|ESC ^}} || 0x9e || {{nobr|PM – 私有消息(Privacy Message)}}
|- id=APC
| {{nobr|ESC _}} || 0x9f || {{nobr|APC – 应用程序命令(Application Program Command)}}
|- id=RIS
| {{nobr|ESC c}} || || {{nobr|RIS – 重置为初始状态(Reset to Initial State)}} ||将设备重置为原始状态。可能包括(如果适用的话):重置图形格式,清除制表符,重置为默认字体等等。
|}

导航菜单