Chalk: Chalk v3 beta feedback

Created on 27 Sep 2019  路  4Comments  路  Source: chalk/chalk

This issue is for discussing the upcoming Chalk v3 version which is now in beta.

Beta 1: https://github.com/chalk/chalk/releases/tag/v3.0.0-beta.1

Let us know if you encounter any issues with upgrading or if anything is unclear in the release notes.

Most helpful comment

All 4 comments

It seems like it breaks @Qix-'s code on https://github.com/Berkmann18/nclr/pull/109#issuecomment-505652869.
I'm not familiar with the code and what changed since he posted the work-around so other than the chalk.constructor.prototype -> chalk.Instance.prototype, I'm unsure how to go about it.

Hey there.

I believe this is also a problem in 2.x.x code, but, I'm currently using the 3.0.0.beta.2, and
I have found that with macOS 10.15, using Node.js 'child_process.spawn()` that the child process is determining that there is no color support, so things are looking pretty 'bland' as a result.

However, if I create a new chalk instance (as documented) with const ctx = new chalk.Instance({level: 3}) then the result is very colorful (as expected).

It would be really good if the spawned child process would detect that color is available all by itself.

Keep up the good work!

@pbelbin This is pretty difficult to reason about, and is less of a problem with chalk and more a problem with how Node manages child process file descriptors and pseudo-terminals. The best we can _programmatically_ determine is based off of environment variables and the result of isatty, which are both handled in supports-color.

Beyond that, we try not to do clever hacks to detect color support because, frankly, the technologies are just outdated and anything more than following decades-old TTY "standards" will inevitably break a bunch of people.

I, too, wish this was better handled. Unfortunately, our hands are tied. As you suspected, this is not a Chalk 3 problem.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

LeoAref picture LeoAref  路  8Comments

Elberet picture Elberet  路  4Comments

RichaJha1119 picture RichaJha1119  路  5Comments

erquhart picture erquhart  路  6Comments

CPatchane picture CPatchane  路  8Comments