Sublime Forum

How to remove escape characters from a build output

#1

I am using a custom build system for serving html pages and the output looks something like below:

0x1be[33mhttp://0.0.0.0:8080 is already in use. Trying another port.e0x1b[39m
0x1be[36mReady for changese[39m
0x1be[32mServing "D:\grid\index.html" at http://127.0.0.1:60086e0x1b[39m

How do I get rid of those escape characters to produce a more cleaner build output ?

0 Likes

#2

If the program you’re using in your build system has a command line option or an environment variable that tells it not to generate ANSI color output, that would probably be the quickest way to get rid of them.

If that’s not the case then you would need a custom build target that filters them out of the output that it adds to the output panel. Alternatively something like ANSIescape can be used as the target in a build system to interpret the codes as colors so that you get the colorized output.

0 Likes