ANSI questions: "\ x1B [? 25h" and "\ x1BE"

  • What does the "\x1B[?25h" do?
  • How is "\x1BE" different from "\n" ? According to http://ascii-table.com/ansi-escape-sequences-vt-100.php , does it "go to the next line"? Looks like "\n" doing?

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

Any ideas?

Thanks!

+6
source share
1 answer

These are ANSI escape sequences (also known as VT100 codes), an early standardization of control codes previously dated ASCII.

The \x1BE sequence \x1BE or Esc + E is NEL or the "Next Line" and is used for older terminals and mainframes to denote CR + LF or \r\n .

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

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

Literature:

+12
source

All Articles