Skip to content

Commit

Permalink
Changed escape sequence from "\e" to "\033"
Browse files Browse the repository at this point in the history
Apparently, "\e" is GNU-only.
  • Loading branch information
avdstaaij committed Nov 25, 2021
1 parent c61e4eb commit 09a4302
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions include/aecpp.h
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ inline typename std::enable_if<
operator<<(std::ostream& os, Code code) {
if (aecImplementation::aecEnabled(os)) {
std::ostream osUnformatted(os.rdbuf());
osUnformatted << "\e[" << static_cast<unsigned short>(code) << "m";
osUnformatted << "\033[" << static_cast<unsigned short>(code) << "m";
}
return os;
}
Expand All @@ -331,16 +331,16 @@ inline std::ostream& operator<<(std::ostream& os, const Style& style) {
if (style.reset) {osUnformatted << reset;}
bool wroteEsc = false;
if (style.effect != static_cast<Effect>(-1)) {
osUnformatted << "\e[" << static_cast<unsigned short>(style.effect);
osUnformatted << "\033[" << static_cast<unsigned short>(style.effect);
wroteEsc = true;
}
if (style.color != static_cast<Color>(-1)) {
osUnformatted << (wroteEsc ? ";" : "\e[")
osUnformatted << (wroteEsc ? ";" : "\033[")
<< static_cast<unsigned short>(style.color);
wroteEsc = true;
}
if (style.bgcolor != static_cast<BGColor>(-1)) {
osUnformatted << (wroteEsc ? ";" : "\e[")
osUnformatted << (wroteEsc ? ";" : "\033[")
<< static_cast<unsigned short>(style.bgcolor);
wroteEsc = true;
}
Expand Down

0 comments on commit 09a4302

Please sign in to comment.