iliazeus / vscode-ansi

VS Code extension enabling ANSI color styling for text documents
https://marketplace.visualstudio.com/items?itemName=iliazeus.vscode-ansi
MIT License
57 stars 6 forks source link

Open .ansi showing "esc[36m" characters #20

Closed Khaaz closed 1 year ago

Khaaz commented 1 year ago

Hello,

This extension is awesome and work great with the Open Preview command. However I would love it to automatically run the Open Preview or at least make it easier to run. I am using .log. files but I try to use .ansi as it's supposed to automatically parse it with colors. It indeed does it but I still have weird "escape characters" (see screenshot). image

Would it be possible to:

iliazeus commented 1 year ago

I am using .log. files but I try to use .ansi as it's supposed to automatically parse it with colors. It indeed does it but I still have weird "escape characters" (see screenshot).

This is a limitation that is not possible to currently overcome, at least with the way the extension is currently implemented.

Have an option to choose the file extension that will automatically be syntax highlighter (in my case .log

This is possible, I will look into it when I have time.

iliazeus commented 1 year ago

The problem with visible escape character in the "Open Preview" mode should be resolved in the latest version.

Have an option to choose the file extension that will automatically be syntax highlighter (in my case .log

You can set this up yourself. In your .log file, press F1 - Change Language Mode - Configure File Association for '.log' - ANSI text.

Khaaz commented 1 year ago

Thank you for your answer, and for resolving this issue. Much appreciated.

For the record:

I understand that this is a limitation we can't get passed by, I just wanted to follow up 👍🏻 If it's possible somehow to overcome said limitation though it would be awesome as it is the only thing missing in this extension really.

Last thing: I suggest to add the Change Language Mode feature in the README as it would help new users. If possible, it could be interesting to have that as an option in the extension itself (so it can be added to workspace for instance) although it's definitely not mandatory.

Thanks