ANSI terminal special escape code macros.
More...
Detailed Description
Module Source Dependencies
The following files must be built with any user project that uses this module:
Module Description
Escape code macros for ANSI compliant text terminals.
- Note:
- If desired, the macro
DISABLE_TERMINAL_CODES
can be defined in the project makefile and passed to the GCC compiler via the -D switch to disable the terminal codes without modifying the source, for use with non compatible terminals (any terminal codes then equate to empty strings).
Example Usage
The following snippet is an example of how this module may be used within a typical application.
Define Documentation
Creates an ANSI escape sequence with the specified payload.
- Parameters:
-
[in] | EscapeSeq | Payload to encode as an ANSI escape sequence, a ESC_* mask. |
Sets the text background colour to black.
Sets the text background colour to blue.
Sets the text background colour to cyan.
Sets the text background colour to the terminal's default.
Sets the text background colour to green.
Sets the text background colour to magenta.
Sets the text background colour to red.
Sets the text background colour to white.
Sets the text background colour to yellow.
Turns off bold so that any following text is printed to the terminal in non bold.
Turns on bold so that any following text is printed to the terminal in bold.
Moves the cursor to the left the given number of columns.
- Parameters:
-
[in] | Columns | Number of columns to move the cursor position |
Moves the cursor down the given number of lines.
- Parameters:
-
[in] | Lines | Number of lines to move the cursor position |
Moves the cursor to the right the given number of columns.
- Parameters:
-
[in] | Columns | Number of columns to move the cursor position |
Sets the cursor position to the given line and column.
- Parameters:
-
[in] | Line | Line number to position the cursor at. |
[in] | Column | Column number to position the cursor at. |
Moves the cursor up the given number of lines.
- Parameters:
-
[in] | Lines | Number of lines to move the cursor position |
Erases the entire display, returning the cursor to the top left.
Erases the current line, returning the cursor to the far left.
Sets the foreground (text) colour to black.
Sets the foreground (text) colour to blue.
Sets the foreground (text) colour to cyan.
Sets the foreground (text) colour to the terminal's default.
Sets the foreground (text) colour to green.
Sets the foreground (text) colour to magenta.
Sets the foreground (text) colour to red.
Sets the foreground (text) colour to white.
Sets the foreground (text) colour to yellow.
Turns off inverse so that any following text is printed to the terminal in non inverted colours.
Turns on inverse so that any following text is printed to the terminal in inverted colours.
Turns off italics so that any following text is printed to the terminal in non italics.
Turns on italics so that any following text is printed to the terminal in italics.
Resets any escape sequence modifiers back to their defaults.
Turns off strikethrough so that any following text is printed to the terminal without a line through the center.
Turns on strikethrough so that any following text is printed to the terminal with a line through the center.
Turns off underline so that any following text is printed to the terminal non underlined.
Turns on underline so that any following text is printed to the terminal underlined.