ANSI问题:“\ x1B[?25 h”和“\ x1BE”

时间:2022-02-09 06:22:01
  1. What does "\x1B[?25h" do?
  2. “\ x1B[什么?25 h”做什么?
  3. How is "\x1BE" different from "\n"? According to http://ascii-table.com/ansi-escape-sequences-vt-100.php it "moves to next line"? Seems like that's what "\n" does?

    “\x1BE”与“\n”有什么不同?根据http://asciitable.com/ansi-escapesequences -vt-100.php,它“移动到下一行”?看起来是这样的吗?

    I tried echo "xxx\nxxx\n" and echo "xxx\x1BExxx\n" in PHP and they both output the same thing.

    我在PHP中尝试了echo“xxx\nxxx\n”和echo“xxx\x1BExxx\n”,它们的输出都是一样的。

Any ideas?

什么好主意吗?

Thanks!

谢谢!

1 个解决方案

#1


12  

These are ANSI escape sequences (also known as VT100 codes) are an early standardisation of control codes pre-dating ASCII.

这些是ANSI转义序列(也称为VT100代码)是一种早期的标准化的控制代码。

The escape sequence \x1BE, or Esc+E, is NEL or "Next line", and is used on older terminals and mainframes to denote CR+LF, or \r\n.

转义序列\x1BE,或Esc+E,是NEL或“下一行”,用于较旧的终端和大型机,以表示CR+LF,或\r\n。

The escape sequence \x1B[ (Esc+[) is an example of a Control Sequence Introducer. (\x9B is another single-character CSI.) The control sequence ?25h following it is used to show the cursor.

转义序列\x1B[(Esc+[)是控制序列导入器的一个例子。(\x9B是另一个单字符CSI。)控制序列?25h跟随它来显示光标。

Most terminals will support these control codes; to enter escape sequences you can type Ctrl+V, Ctrl+[ which should render as ^[ (the C0 code for ESC), followed by the escape code.

大多数终端将支持这些控制代码;输入转义序列可以键入Ctrl + V,Ctrl +[应该呈现为^[(ESC)的C0代码,其次是转义代码。

References:

引用:

#1


12  

These are ANSI escape sequences (also known as VT100 codes) are an early standardisation of control codes pre-dating ASCII.

这些是ANSI转义序列(也称为VT100代码)是一种早期的标准化的控制代码。

The escape sequence \x1BE, or Esc+E, is NEL or "Next line", and is used on older terminals and mainframes to denote CR+LF, or \r\n.

转义序列\x1BE,或Esc+E,是NEL或“下一行”,用于较旧的终端和大型机,以表示CR+LF,或\r\n。

The escape sequence \x1B[ (Esc+[) is an example of a Control Sequence Introducer. (\x9B is another single-character CSI.) The control sequence ?25h following it is used to show the cursor.

转义序列\x1B[(Esc+[)是控制序列导入器的一个例子。(\x9B是另一个单字符CSI。)控制序列?25h跟随它来显示光标。

Most terminals will support these control codes; to enter escape sequences you can type Ctrl+V, Ctrl+[ which should render as ^[ (the C0 code for ESC), followed by the escape code.

大多数终端将支持这些控制代码;输入转义序列可以键入Ctrl + V,Ctrl +[应该呈现为^[(ESC)的C0代码,其次是转义代码。

References:

引用: