windows-7windows-consoledeno

What are these "←[<number>" things Deno prints to the console?


When I run a Javascript file with Deno ...

// file.js
console.log(42)

... doing deno run file.js, then Deno prints ...

←[33m42←[39m

... to the standard Windows 7 console (cmd.exe). What is this, and how can I fix this?


Solution

  • Seemingly these are ansi color escape sequences, but on Windows 7 this is not supported in the standard console, resulting in these strange characters. There are two fixes for this:

    1. Disable colors

    If you add an environment variable NO_COLOR=true Deno will not color the output anymore and these characters will disappear. If you remove the variable again, you may have to restart Windows in order to get back the coloring.

    See also deno help.

    A helpful tool to edit environment variables is RapidEE.

    2. Use a console emulator

    If you want the colors, use a console emulator like cmder.