From 09a4302fd647d1435125371c601e56ff21d864e8 Mon Sep 17 00:00:00 2001 From: Arthur van der Staaij Date: Thu, 25 Nov 2021 11:28:55 +0100 Subject: [PATCH] Changed escape sequence from "\e" to "\033" Apparently, "\e" is GNU-only. --- include/aecpp.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/aecpp.h b/include/aecpp.h index 1f700cb..111d1bf 100644 --- a/include/aecpp.h +++ b/include/aecpp.h @@ -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(code) << "m"; + osUnformatted << "\033[" << static_cast(code) << "m"; } return os; } @@ -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(-1)) { - osUnformatted << "\e[" << static_cast(style.effect); + osUnformatted << "\033[" << static_cast(style.effect); wroteEsc = true; } if (style.color != static_cast(-1)) { - osUnformatted << (wroteEsc ? ";" : "\e[") + osUnformatted << (wroteEsc ? ";" : "\033[") << static_cast(style.color); wroteEsc = true; } if (style.bgcolor != static_cast(-1)) { - osUnformatted << (wroteEsc ? ";" : "\e[") + osUnformatted << (wroteEsc ? ";" : "\033[") << static_cast(style.bgcolor); wroteEsc = true; }