Is there a way to display colors (like in a terminal) in the Debug Console of Visual Studio Code (Version 1.10.2) when debugging node.js code?
Really quick and dirty for Java console from a Java noob:
private static void debugLog(String msg) {
if (msg.indexOf("Exception") > -1) {
System.out.println("\u001b[31m" + msg + "\u001b[0m");
} else {
System.out.println("\u001b[32m" + msg + "\u001b[0m");
}
}
Adding the --colors
argument worked for me. (I'm using jest).
{
"version": "0.2.0",
"configurations": [{
"type": "node",
"name": "vscode-jest-tests",
"request": "launch",
"args": ["--colors"],
"runtimeArgs": [
"--inspect-brk",
"${workspaceRoot}/node_modules/.bin/jest",
"--runInBand"
],
"cwd": "${workspaceFolder}",
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"port": 9229
}]
}