Reputation: 1991
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:
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
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 :
Terminal Color and Style Highlighting for VS Code
Tobias-Faller is the developper, and sources are on his/her github repo.
Ilia Pozdnyakov is the developper, and sources are on his/her github repo.
Upvotes: 6
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