Escape codes for terminal

jmumby

Senior Member
Im trying to get text to change colour (color for Americans) in hyper terminal this site http://pueblo.sourceforge.net/doc/manual/ansi_color_codes.html has some escape codes for this so I have tried the following with not to much succses.

Code:
SEROUT ECHO_TX,ECHO_BAUD,(0x1B,0x5B,0x03,0x06,"ted",cr,lf)
SEROUT ECHO_TX,ECHO_BAUD,(0x1B,0x5B,0x03,0x06,0x6d,"ted",cr,lf)
Anyone tried this at all? I guess I am just not interpreting the information correctly.
 

jmumby

Senior Member
Worked it out

Code:
SEROUT ECHO_TX,ECHO_BAUD,(0x1b,0x5b,"31m","test")
will echo text in red. You may have to change your emulation. VT100 works for SERTXD but had to change to ANSI for SEROUT. Multiple formating can be used by separating formatting with a ;.

Code:
1m     -     Change text to hicolour (bold) mode
4m     -        "    "   "  Underline (doesn't seem to work)
5m     -        "    "   "  BLINK!!
8m     -        "    "   "  Hidden (same colour as bg)
30m    -        "    "   "  Black
31m    -        "    "   "  Red
32m    -        "    "   "  Green
33m    -        "    "   "  Yellow
34m    -        "    "   "  Blue
35m    -        "    "   "  Magenta
36m    -        "    "   "  Cyan
37m    -        "    "   "  White
40m    -     Change Background to Black
41m    -        "       "      "  Red
42m    -        "       "      "  Green
43m    -        "       "      "  Yellow
44m    -        "       "      "  Blue
45m    -        "       "      "  Magenta
46m    -        "       "      "  Cyan
47m    -        "       "      "  White
7m     -     Change to Black text on a White bg
0m     -     Turn off all attributes.
 
Top