Almost all manufacturers of video terminals added vendor-specific escape sequences to perform operations such as placing the cursor at arbitrary positions on the screen.
The ANSI standard attempted to address these problems by making a command set that all terminals would use and requiring all numeric information to be transmitted as ASCII numbers.
[2] This model was very successful in the market, which sparked a variety of VT100 clones, among the earliest and most popular of which was the much more affordable Zenith Z-19 in 1979.
[3] Others included the Qume QVT-108, Televideo TVI-970, Wyse WY-99GT as well as optional "VT100" or "VT103" or "ANSI" modes with varying degrees of compatibility on many other brands.
The popularity of these gradually led to more and more software (especially bulletin board systems and other online services) assuming the escape sequences worked, leading to almost all new terminals and emulator programs supporting them.
As computers got more powerful even built-in displays started supporting them, allowing software to be portable between CP/M systems.
[citation needed] The IBM PC, introduced in 1981, did not support these or any other escape sequences for updating the screen.
Any display effects had to be done with BIOS calls, which were notoriously slow, or by directly manipulating the IBM PC hardware.
This made any interesting software non-portable and led to the need to duplicate details of the display hardware in PC Clones.
The Windows Console did not support ANSI escape sequences, nor did Microsoft provide any method to enable them.
Some replacements such as JP Software's TCC (formerly 4NT), Michael J. Mefford's ANSI.COM, Jason Hood's ANSICON[7] and Maximus5's ConEmu enabled ANSI escape sequences.
Software such as the Python colorama package[8] or Cygwin modified text in-process as it was sent to the console, extracting the ANSI Escape sequences and emulating them with Windows calls.
[12]: 13.1 The escape sequences consist only of bytes in the range 0x20—0x7F (all the non-control ASCII characters), and can be parsed without looking ahead.
For Control Sequence Introducer, or CSI, commands, the ESC [ (written as \e[, \x1b[ or \033[ in several programming languages) is followed by any number (including none) of "parameter bytes" in the range 0x30–0x3F (ASCII 0–9:;<=>?
[5]: F.4.2 A subset of arrangements was declared "private" so that terminal manufacturers could insert their own sequences without conflicting with the standard.
The control sequence CSI n m, named Select Graphic Rendition (SGR), sets display attributes.
As 256-color lookup tables became common on graphic cards, escape sequences were added to select from a pre-defined set of 256 colors:[citation needed] The ITU's T.416 Information technology - Open Document Architecture (ODA) and interchange format: Character content architectures[34] uses ":" as separator characters instead:
[citation needed] The ODA version is more elaborate and thus incompatible: The ITU-RGB variation is supported by xterm, with the colorspace ID and tolerance parameters ignored.
[40][41] This system, although poorly documented, became widespread enough for Fedora and RHEL to consider using it as a simpler and more universal detection mechanism compared to querying the now-updated libraries.
[43] Most Operating System Command sequences were defined by Xterm, but many are also supported by other terminal emulators.
[46] The Linux console uses ESC ] P n rr gg bb to change the palette, which, if hard-coded into an application, may hang other terminals.
[citation needed] If the ESC is followed by a byte in the range 0x60—0x7E, the escape sequence is of type Fs.
If the ESC is followed by a byte in the range 0x30—0x3F, the escape sequence is of type Fp, which is set apart for up to sixteen private-use control functions.
Some others: If the first byte is '#' the public sequences are reserved for additional ISO-IR registered individual control functions.
[12]: 6.5.3 CSI 2 J — This clears the screen and, on some devices, locates the cursor to the y,x position 1,1 (upper left corner).
For example, on compatible terminals, the following list command color-codes file and directory names by type.
For example, the following GNU sed command embellishes the output of the make command by displaying lines containing words starting with "WARN" in reverse video and words starting with "ERR" in bright yellow on a dark red background (letter case is ignored).
[53] The following Bash function flashes the terminal (by alternately sending reverse and normal video mode codes) until the user presses a key.
When typing input on a terminal keypresses outside the normal main alphanumeric keyboard area can be sent to the host as ANSI sequences.
[13] Thomas Dickey has added a lot of support to it over time;[56] he also maintains a list of default keys used by other terminal emulators for comparison.