ANSI escape code

From Just Solve the File Format Problem
(Difference between revisions)
Jump to: navigation, search
(Links)
 
(3 intermediate revisions by 2 users not shown)
Line 3: Line 3:
 
|subcat=Elements of File Formats
 
|subcat=Elements of File Formats
 
}}
 
}}
The '''ANSI escape codes''' (or '''ANSI codes''', '''control codes''', '''control sequences''', etc.) are a set of standard byte sequences which cause special things to happen when interpreted by certain character-based terminals and other output devices. For example, a code might change the text color, or move the cursor. These codes (or some subset of them) are used [[ANSI Art]] and similar types of files.
+
The '''ANSI escape codes''' (or '''ANSI codes''', '''control codes''', '''control sequences''', etc.) are a set of standard byte sequences which cause special things to happen when interpreted by certain character-based terminals and other output devices. For example, a code might change the text color, or move the cursor. These codes (or some subset of them) are used in [[ANSI Art]] and similar types of files.
  
Most codes produce graphical effects, but a few are intended for sound, or other functions. There are also codes used for input, but such codes are unlikely to be found in data files.
+
Escape sequences start with the ESC character (27 decimal or 1B hex in [[ASCII]] and many other character coding systems including [[Unicode]]; this is part of the [[C0 controls]]).
 +
 
 +
Most codes produce graphical effects, but a few are intended for sound, or other functions. There are also codes used for input (e.g. keyboard input), but such codes are unlikely to be found in data files.
 +
 
 +
== Extended colors ==
 +
The Unix terminal world and the [[ANSI Art]] world unfortunately decided on different ways of extending ANSI codes to support more colors.
 +
 
 +
ANSI Art uses codes like "<code>Esc [ ... t</code>". See [http://picoe.ca/2014/03/07/24-bit-ansi/].
 +
 
 +
Terminal software uses codes like "<code>Esc [ 38; ... m</code>" and "<code>Esc [ 48; ... m</code>". See [https://gist.github.com/XVilka/8346728], and the [[Wikipedia:ANSI_escape_code#Colors|Wikipedia article]].
  
 
== See also ==
 
== See also ==
Line 24: Line 33:
 
* [[Wikipedia: ANSI escape code]]
 
* [[Wikipedia: ANSI escape code]]
 
* [[Wikipedia: ANSI.SYS]]
 
* [[Wikipedia: ANSI.SYS]]
 +
* [https://notes.burke.libbey.me/ansi-escape-codes/ Everything you never wanted to know about ANSI escape codes]
  
 
[[Category:Graphics]]
 
[[Category:Graphics]]

Latest revision as of 19:43, 5 April 2021

File Format
Name ANSI escape code
Ontology

The ANSI escape codes (or ANSI codes, control codes, control sequences, etc.) are a set of standard byte sequences which cause special things to happen when interpreted by certain character-based terminals and other output devices. For example, a code might change the text color, or move the cursor. These codes (or some subset of them) are used in ANSI Art and similar types of files.

Escape sequences start with the ESC character (27 decimal or 1B hex in ASCII and many other character coding systems including Unicode; this is part of the C0 controls).

Most codes produce graphical effects, but a few are intended for sound, or other functions. There are also codes used for input (e.g. keyboard input), but such codes are unlikely to be found in data files.

Contents

[edit] Extended colors

The Unix terminal world and the ANSI Art world unfortunately decided on different ways of extending ANSI codes to support more colors.

ANSI Art uses codes like "Esc [ ... t". See [1].

Terminal software uses codes like "Esc [ 38; ... m" and "Esc [ 48; ... m". See [2], and the Wikipedia article.

[edit] See also

[edit] Specifications

[edit] Links

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox