Jenkins console output has these strange characters from grunt command [31m[[39m...

James Da Costa picture James Da Costa · Feb 28, 2013 · Viewed 10.6k times · Source

I'm running a grunt-contrib-jshint command using jenkins and the console output is contains text like:

[31m[[39m[33mL425[39m[31m:[39m[33mC29[39m[31m][39m [33mExpected a conditional expression and instead saw an assignment.[39m

Any ideas why? and how to fix it.

Running the same script directly displays:

[L425:C29] Expected a conditional expression and instead saw an assignment.

I've checked the file.encoding setting which was set to MacRoman and after setting export JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF-8 is now UTF-8.

Answer

Larry Shatzer picture Larry Shatzer · Feb 28, 2013

Those look like color escape sequences. See if you can pass a parameter like --no-color to the command (if the tool supports it, see this maybe), or look at the AnsiColor plugin