ANSI escape sequences. FOREGROUND COLORS ----------------- [30m = BLACK [31m = RED [32m = GREEN [33m = YELLOW [34m = BLUE [35m = MAGENTA [36m = CYAN [37m = WHITE BACKGROUND COLORS ----------------- [40m = BLACK [41m = RED [42m = GREEN [43m = YELLOW [44m = BLUE [45m = MAGENTA [46m = CYAN [47m = WHITE ATTRIBUTES [5m = BLINK [7m = REVERSE [1m = BOLD [4m = UNDERLINED (IBM Monochrome only) [0m = NORMAL (Cancels colors and attributes) CURSOR POSITIONING [r;cH = Position cursor at row r and column c (i.e. to position cursor at row 12 column 40 you would send the code [12;40H ) n = number [nA = Move cursor ## lines up in same column [nB = Move cursor ## lines down in same column [nC = Move cursor right ## columns on same line [nD = Move cursor left ## columns on same line [0K = Erase cursor to end of line [1K = Erase from beginning of line to cursor [2K = Erase entire line containing cursor [0J = Erase from cursor to end of screen [1J = Erase from beginning of screen to cursor [2J = Erase entire screen Command stringing is allowed. For example, to change the screen to bright yellow foreground on a blue background you would send the code: [0;1;33;44m Explanation: [ = initialization sequence 0 = reset to normal characters 1 = set for bold characters 33 = set for yellow foreground characters 44 = set for blue background characters m = terminator