Search code examples
c++consoleconsole-output

C++ Colored text in console not showing when launching application directly


enter image description hereI have implemented my own Logging class for my applications I write in C++. I implemented the Logging class using this way (https://stackoverflow.com/a/54062826/12873837) of coloring the text. It does work very well, if I launch my program inside visual studio with the debugger, but it doesn't if I launch my application directly. Instead of colored text, the ANSI escape color codes get printed directly before my actual console output. Any ideas why this could happen?

This screenshot is the output, if I start the application directly.


Solution

  • Thanks to @1201ProgramAlarm I finally found the solution here: https://stackoverflow.com/a/63426872/12873837

    This worked perfectly fine for me :)