Use \x1b instead of \e

This commit is contained in:
Clement Jamin 2015-06-16 13:55:37 +02:00
parent a4328cc4cb
commit 2e6db170a5
1 changed files with 5 additions and 5 deletions

View File

@ -14,7 +14,7 @@ inline std::ostream& blue(std::ostream &s)
SetConsoleTextAttribute(hStdout,
FOREGROUND_BLUE|FOREGROUND_GREEN|FOREGROUND_INTENSITY);
#else
s << "\e[0;34m";
s << "\x1b[0;34m";
#endif
return s;
}
@ -25,7 +25,7 @@ inline std::ostream& red(std::ostream &s)
HANDLE hStdout = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleTextAttribute(hStdout, FOREGROUND_RED|FOREGROUND_INTENSITY);
#else
s << "\e[0;31m";
s << "\x1b[0;31m";
#endif
return s;
}
@ -36,7 +36,7 @@ inline std::ostream& green(std::ostream &s)
HANDLE hStdout = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleTextAttribute(hStdout, FOREGROUND_GREEN|FOREGROUND_INTENSITY);
#else
s << "\e[0;32m";
s << "\x1b[0;32m";
#endif
return s;
}
@ -48,7 +48,7 @@ inline std::ostream& yellow(std::ostream &s)
SetConsoleTextAttribute(hStdout,
FOREGROUND_GREEN|FOREGROUND_RED|FOREGROUND_INTENSITY);
#else
s << "\e[0;33m";
s << "\x1b[0;33m";
#endif
return s;
}
@ -60,7 +60,7 @@ inline std::ostream& white(std::ostream &s)
SetConsoleTextAttribute(hStdout,
FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE);
#else
s << "\e[0;37m";
s << "\x1b[0;37m";
#endif
return s;
}