Search code examples
pythonxtermansi-escape

What does "1B63" mean in bash?


When I print the string value of 0x1b63 in bash, the screen clear (exactly like tput reset result): enter image description here

After pressing Enter button we have:

enter image description here

What is going on?


Solution

  • It's ANSI escape sequences. There's a list of some on wikipedia

    \x1b means ESC \x63 is a lower case c

    On that page ESC c is shown as

    RIS – Reset to Intitial State Resets the device to its original state. This may include (if applicable): reset graphic rendition, clear tabulation stops, reset to default font, and more.

    so the terminal will clear. This isn't related to bash, or python, but the terminal that you're running in.