Gulp: No colors in gulp output

Created on 29 Jan 2014  路  12Comments  路  Source: gulpjs/gulp

In a custom task, chalk seems enabled.

console.log(gutil.colors.enabled);
console.log(gutil.colors.supportsColor);

But core gulp output will not be coloured, like this one.

I still can force with gulp --color argument, but this is not very friendly.

Am I missing something there?

Most helpful comment

After investigations, it boils down to the "supports-colors" package checking "process.stdout.isTTY" which is false under minTTY (on windows 10, not sure about other windows versions) but true under cmd.exe, you can workaround this by setting a FORCE_COLOR environment variable.

The root issue seems to be discussed in here: https://github.com/nodejs/node/issues/3006 and perhaps here https://github.com/mintty/mintty/issues/56

All 12 comments

Need all of your versions and OS info cc @sindresorhus

@rayfranco you need to also update your global gulp: npm update -gf gulp

@Contra i fixed a bug earlier today in chalk (has-color) that @rayfranco reported.

@sindresorhus I missed the global flag and only updated local install. Thanks for quick reply (again).

My problem is gulp doesn't output color when spawned as a child process whose stdio is inherit from parent process.

anyway to fix this? colored output is easier to discern... :)

btw, i'm using MINGW64 (via git installer 2.6) on windows 10

image

No colors in MINGW64 too since latest SourceTree version update :(

@ericnewton76 @rs3d I have the same issue but I suspect that should be reported to the minTTY devs (shell used by the last git for windows versions).

Side note: gulp-mocha does display colors in this shell (is there 2 distinct syntaxes to display colors and only one is supported by minTTY?)

After investigations, it boils down to the "supports-colors" package checking "process.stdout.isTTY" which is false under minTTY (on windows 10, not sure about other windows versions) but true under cmd.exe, you can workaround this by setting a FORCE_COLOR environment variable.

The root issue seems to be discussed in here: https://github.com/nodejs/node/issues/3006 and perhaps here https://github.com/mintty/mintty/issues/56

@guillaume86 Thanks a lot, Setting FORCE_COLOR in my environment helped me to workaround the win10 problem.

@rs3d - How do you set this variable on windows? I am clueless

@yairEO try this http://www.computerhope.com/issues/ch000549.htm#windows8 and set FORCE_COLOR to true

@rs3d Ha, THOSE variables! everybody here keep saying "variables" and I was thinking what variables?! I didn't make the connection to windows System Variables. Thanks! it works great! (Win7)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tom10271 picture tom10271  路  4Comments

ankurp picture ankurp  路  5Comments

joe-watkins picture joe-watkins  路  5Comments

ssteinerx picture ssteinerx  路  3Comments

borodean picture borodean  路  5Comments