ANSI escape code
also: ANSI code, escape sequence, CSI sequence, VT100 escape code
A special sequence of characters that controls text formatting, color, and cursor movement in terminal output. ANSI escape codes begin with the ESC character (ASCII 27) followed by brackets and parameters.
ANSI escape codes are standardized character sequences used to control how text appears in a terminal or console. They allow programs to set text color, background color, bold/italic styles, cursor position, and other display attributes without requiring special terminal hardware.
An ANSI escape code always starts with the ESC character (represented as \033 or \x1b in many languages) followed by a bracket [ and then a parameter sequence ending with a letter. For example, \033[1;31m sets text to bold red, while \033[0m resets formatting to default.
Common applications using ANSI escape codes include command-line tools like ls --color, colored log output, terminal text editors, and system monitoring utilities. Most modern terminals automatically interpret these codes, though some older or restricted environments may not support them.