Vscode-code-runner: ANSI color codes are not rendered correctly using Node

Created on 19 Sep 2018  路  2Comments  路  Source: formulahendry/vscode-code-runner

If you run this piece of JS e.g.:

console.log("\x1b[31m" + "Test" + "\x1b[0m")

You should get the word Test in red, however the output reads something like this:

[Running] node "...\tempCodeRunnerFile.javascript"
Test

[Done] exited with code=0 in 0.285 seconds

When run manually from the command line it works:

image

Probably an encoding issues. Tested on Windows 7.

Most helpful comment

Please use below setting (File->Preference->Settings) to run code in Integrated Terminal:

{
    "code-runner.runInTerminal": true
}

All 2 comments

Please use below setting (File->Preference->Settings) to run code in Integrated Terminal:

{
    "code-runner.runInTerminal": true
}

Please use below setting (File->Preference->Settings) to run code in Integrated Terminal:

{
    "code-runner.runInTerminal": true
}

I think it will is default setting better

Was this page helpful?
0 / 5 - 0 ratings

Related issues

spacesuitdiver picture spacesuitdiver  路  3Comments

w3adventures picture w3adventures  路  3Comments

nmchgx picture nmchgx  路  3Comments

N2ITN picture N2ITN  路  5Comments

seiferthan picture seiferthan  路  4Comments