question

LapoFalcone-5135 avatar image
0 Votes"
LapoFalcone-5135 asked ·

Color ANSI codes don't work anymore

I wrote a program in C++ about 2/3 weeks ago. It has a line where it should print some text with a specific color. To do so I decided to use ANSI escape color codes. I know there are other ways, but this one seems the most straight forward.

So for example I used: std::cout << "\x1B[31mTEST RED\033[0m\n"; to print red text.

I compiled and linked the code using MSVC, it produced an .exe file, I ran it and all worked fine.

Yesterday I ran that same .exe file again, but this time it printed the string "←[31mTEST RED←[0m", white.

I don't know how is this possible, I haven't touched the .exe file in any way, but 2 weeks ago it worked, now it doesn't!

I contacted MS support, and they tried to update my Windows version to the newest one, but it didn't solved the issue, so they told me to ask here.

If you need more information I'll give it to you as soon as possible. Thanks!

not-supported
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

LeonLaude avatar image
0 Votes"
LeonLaude answered ·

Hi,

Q&A currently supports the products listed over here https://docs.microsoft.com/en-us/answers/products (more to be added later on).

You can reach the experts in the dedicated Microsoft Visual Studio forum over here:
https://social.msdn.microsoft.com/Forums/vstudio/en-US/home?category=visualstudio

(Please don't forget to accept helpful replies as answer)

Best regards,
Leon


· 1 ·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks, asked there!

0 Votes 0 ·