Chalk: Chalk doesn't detect color support for VSCode Debug Console

Created on 9 Feb 2018  路  4Comments  路  Source: chalk/chalk

Chalk works perfect for nearly all use cases we have and we make heavy use of testing for chalk.enabled to decide how we format our log output. This works in the local command line as expected and logs are printed colorfully.

Since we're switching from Atom to VSCode I've noticed that the color mode detection doesn't seem to work for the VSCode console. chalk reports supportsColor and enabled both being false. The VSCode Debug Console clearly supports colors and if I manually enforce chalk to use colors it works fine and as expected. But I wonder if this automatic detection is something that can be fixed?

bug help wanted

Most helpful comment

@sindresorhus can I pick this up? :)

All 4 comments

This is what we use for detecting color support: https://github.com/chalk/supports-color I don't use VSCode, but you could look in supports-color where it's returning false for color support.

@sindresorhus can I pick this up? :)

Sure, go ahead :)

@sindresorhus @arabold fixed! albeit a little hacky

https://github.com/chalk/supports-color/pull/77

It is because vscode debugger is not a full terminal emulator

https://github.com/Microsoft/vscode/issues/3006#issuecomment-190664166

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Martodox picture Martodox  路  3Comments

LeoAref picture LeoAref  路  8Comments

ORESoftware picture ORESoftware  路  6Comments

erquhart picture erquhart  路  6Comments

Offirmo picture Offirmo  路  4Comments