Vscode ASCII Standard Sequences (ANSI)

Asked

Viewed 558 times

-1

I’m intending to migrate from pycharm to VS Code. It’s just that there’s something going wrong. Something that was enough as I use in pycharm to make the text more friendly, misses the use of certain sequences of the ASCII pattern, as:

"\033[1m" = bold

"\033[4m" = sublimated

between others (even change the color of the text and the background).

This is unfortunately not interpreted by the VS Ccode terminal. How can I resolve this?

1 answer

1

First of all, these are "ANSI" sequences, not "ASCII". As for your question - the problem is Windows that does not enable these sequences by default - they work on Mac, Linux, and other environments, and even in the old DOS, before Windows, it was easier to activate them.

Pycharm uses another terminal of his own, which is why his records work.

To enable ANSI sequences in the standard Windows terminal (which should probably work for the terminal used for VS Code as well), the easiest way is to use the third library called "Coloram".

Install it with Pip, pip install colorama, and in your Python program, put those lines at the beginning:

 import colorama
 colorama.init()
  • Thank you, it doesn’t work as well as pycharm, but it works. So I was researching it works better with the UNIX standard...

Browser other questions tagged

You are not signed in. Login or sign up in order to post.