the following example runs fine in a Console Project on Linux
Code: Select all
#include <iostream>
using std::cout; using std::endl;
// Reference : http://en.wikipedia.org/wiki/ANSI_escape_code#graphics
enum ANSI_Attrib { ANSI_Reset=0, ANSI_Bright=1, ANSI_Faint=2,
ANSI_Underline=4, ANSI_Blink_Slow=5,
ANSI_Blink_Rapid=6, ANSI_Inverse=7,
ANSI_Font_Std=10,
ANSI_Font1=11, ANSI_Font2=12, ANSI_Font3=13,
ANSI_Font4=14, ANSI_Font5=15, ANSI_Font6=16,
ANSI_Font7=17, ANSI_Font8=18, ANSI_Font9=19,
ANSI_Normal=22, ANSI_NonItalic=23, ANSI_Underline_Off=24,
ANSI_Black=30, ANSI_Red=31, ANSI_Green=32, ANSI_Yellow=33,
ANSI_Blue=34, ANSI_Magenta=35, ANSI_Cyan=46, ANSI_White=37,
ANSI_StdColor = 39,
ANSI_B_Black=40, ANSI_B_Red=41, ANSI_B_Green=42, ANSI_B_Yellow=43,
ANSI_B_Blue=44, ANSI_B_Magenta=45, ANSI_B_Cyan=46, ANSI_B_White=47,
ANSI_B_StdColor=49 };
int main() {
char CSI[] = "\x1b[\0", CSI_End='m', CSI_Sep=';';
cout << CSI << ANSI_Blink_Slow << CSI_End
<< CSI << ANSI_Bright << CSI_Sep << ANSI_Red << CSI_End << "Hello"
<<endl;
return 0;
}
Is it possible to get this running under MinGW?
Many thanks for a hint,
Helmut.