Ryu S.
Ryu S.

Reputation: 1991

How can I display ANSI colored logfile text in VS Code

When I open a log file in VS Code, it automatically colors words like "INFO" and "WARN". However, if there are ANSI colors inserted into the file, it can't parse it correctly and shows the following:

ANSI colors

Is there a way to correctly show the ANSI colors or atleast hide those characters so they don't get in the way?

Upvotes: 16

Views: 9115

Answers (2)

Osamoele
Osamoele

Reputation: 476

As of 2023, there is now several very nice VSCode extension made for that, given that Visual Studio Code doesn't support it natively :

Upvotes: 6

Mark
Mark

Reputation: 182571

I'm afraid not, there is no ansi escape sequence support in the editors. See https://github.com/microsoft/vscode/issues/38834

It was added to the Backlog though so there is some hope. Upvote the issue!

As for hiding, the new Column Selection Mode in v1.43 might work for you to delete all that if it is as neatly formatted as your example text. See Column selection like Visual Studio

Upvotes: 3

Related Questions