This file is the html version of ansi.ans. Ansi codes begin with ^[ aka ESC or '\033'. Often they start with ^[[ or ^[O. The following codes are used on input. Some are also used on output.
| Keyboard | Code | Output Action if any or comment |
|---|---|---|
| Ctrl-? | It's the character given by taking the capital letter's ASCII code and subtracting 64. See ascii.asc. | |
| Alt-? | Usually represented by ^[X where X is the capital letter. | |
| Up | ^[[A | Go up a line |
| Down | ^[[B | Go down a line |
| Right | ^[[C | Go right a line |
| Left | ^[[D | Go left a line |
| End | ^[OF | |
| Home | ^[OH | |
| Insert | ^[[2~ | |
| Delete | ^[[3~ | |
| PageUp | ^[[5~ | |
| PageDown | ^[[6~ | |
| F1 | ^[OP | |
| F2 | ^[OQ | |
| F3 | ^[OR | |
| F4 | ^[OS | |
| F5 | ^[[15~ | |
| F6 | ^[[17~ | not a typo... q(>n<) |
| F7 | ^[[18~ | |
| F8 | ^[[19~ | |
| F9 | ^[[20~ | |
| F10 | ^[[21~ | |
| F11 | ^[[23~ | again, not a typo... (;-;) |
| F12 | ^[[24~ |
Where there is an optional number operand, I put a red N. The default is usually 1.
| ^[[NA | Up N rows. |
| ^[[NB | Down N rows. |
| ^[[NC | Right N columns. |
| ^[[ND | Left N columns. |
| ^[[NE | Beginning of the line N lines down. |
| ^[[NF | Beginning of the line N lines up. |
| ^[[NG | Move to column N. |
| ^[[N;MH | Move to row N column M. |
| ^[[0J | Erase everything below cursor. |
| ^[[1J | Erase everything above cursor. |
| ^[[2J | Erase everything. |
| ^[[0K | Erase in the line to right of cursor. |
| ^[[1K | Erase in the line to left of cursor. |
| ^[[2K | Erase the whole line. |
All the graphical sequences are contained in a sequence like ^[[Xm where X is a sequence of integers separated by semicolons.
| 0 | Reset all graphics to normal. |
| 1 | Bold, often brightens the color as well/instead. |
| 2 | Dim, usually actually does underline. |
| 3 | Italic, usually actually does reverse video. |
| 4 | Underline. |
| 5 | Blink, usually actually does bold. |
| 7 | Reverse video. |
| 8 | Invisible. (rarely works) |
| 9 | Crossed-out. (rarely works) |
| 21 | Double underline. (rarely works) |
| 22 | Un-bold text. |
| 23 | Un-italic text. |
| 24 | Un-underlined text. |
| 25 | Un-blinking text. |
| 27 | Un-reverse video. |
| 28 | Un-invisible text. |
| 29 | Un-crossed-out text. |
| 30 | Text color black. Text color black, that is. |
| 31 | Text color red. |
| 32 | Text color green. |
| 33 | Text color yellow. |
| 34 | Text color blue. |
| 35 | Text color magenta. |
| 36 | Text color cyan. |
| 37 | Text color white. |
| 39 | Text color default. |
| 40 | Bg color black., bg color black, that is. |
| 41 | Bg color red. |
| 42 | Bg color green. |
| 43 | Bg color yellow. |
| 44 | Bg color blue. |
| 45 | Bg color magenta. |
| 46 | Bg color cyan. |
| 47 | Bg color white., bg color white that is. |
| 49 | Bg color default. |