Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Task runner colors #9

Open
mjosh954 opened this issue Dec 23, 2015 · 19 comments
Open

Task runner colors #9

mjosh954 opened this issue Dec 23, 2015 · 19 comments

Comments

@mjosh954
Copy link

Is there a way for the Task Runner Explorer output to also display colors like the Gulp Task Runner does? I started to convert most of my gulp tasks in to npm commands and when I run a eslint from my gulp task runner, it comes all colored. However, when I run the same command from npm, it's standard b/w.

@scottaddie
Copy link
Collaborator

@mjosh954 @madskristensen The problem is that the npm CLI doesn't offer a --color switch like the Gulp CLI does. I'm aware of the following npm modules which could be used to provide color:

  1. chalk
  2. cli-color

I'm thinking that one of these modules would need to be installed locally with the NPM Scripts Task Runner extension. Not sure how involved that is or if it's even possible to do with an extension.

@madskristensen
Copy link
Owner

Colors would be nice. We can ship the needed node modules with this extension. How would chalk/cli-color work with npm scripts? How do you hook it up?

I believe the missing colors is a Windows only issue and the real fix might be in sending a PR to npm to fix it

@scottaddie
Copy link
Collaborator

I've found a much simpler way to accomplish this which doesn't require any additional dependencies. Look for a PR either later tonight or early tomorrow.

@scottaddie
Copy link
Collaborator

PR submitted. Apparently, it is possible to set color via the CLI. It just isn't explicitly documented.

@opeologist
Copy link

doesn't look like the colors are working when using latest node version. any ideas of how to get colors working when using latest node version in NPM Task Runner? thanks!

@madskristensen
Copy link
Owner

@scottaddie I repro the issue but can't find a workaround. Any ideas?

@scottaddie
Copy link
Collaborator

@madskristensen Are you using Node v4 or v6?

@madskristensen
Copy link
Owner

.NET Core Preview 1 tooling has node v5

@opeologist
Copy link

i'm using latest stable, which is v6

@sgordon3
Copy link

sgordon3 commented Jun 30, 2016

I think this is either not fixed, or the NpmTaskRunner notes need to be updated.

Using:
colors 1.1.2
node 5.12.0
npm 3.8.6

Colors display in a command window but do not display in NpmTaskRunner.

@madskristensen
Copy link
Owner

Colors are being shown when running the update task. This is very strange...

@clarkd
Copy link

clarkd commented Nov 18, 2016

Any progress on this? I'm using the task runner to run some Mocha tests and they look oh so boring without the red crosses and green tickets that I usually see!

@Yerkon
Copy link

Yerkon commented Apr 29, 2017

image
No colors

@scottaddie
Copy link
Collaborator

@Yerkon Can you please provide your Windows, Visual Studio, npm, and Node versions? I ask because some users do see color, including myself. I'm trying to pin down the problematic component(s).

@Yerkon
Copy link

Yerkon commented May 1, 2017

@scottaddie My configuration:

  • Windows 10
  • Visual Studio 2017 Community
  • Node 7.7.3
  • npm 4.1.2

@Yerkon
Copy link

Yerkon commented May 1, 2017

Updated:

  • Node 7.9.0
  • npm 4.2.0

@waynebrantley
Copy link

No color here either
Node 7.7.4
npm version 4.3.0 does not work. Upgraded and 5.3.0 does not work.
Using VS2017. Command line is:
cmd.exe /c npm run dev --color=always

If I have the yarn.lock file, it runs yarn instead of npm and that has no color either.
yarn version 27.5

I have color for yarn or npm from normal command line of course.

@ghost
Copy link

ghost commented Nov 22, 2017

Same for me.

No colors in NPM Task Runner in Visual Studio (e.g. npm start)
cmd.exe /c npm run start --color=always

Wierd thing is "npm update" works with colors:
cmd.exe /c npm update --color=always

Both started from within NPM Task Runner in Visual Studio of course (normal command line has colors).

So the suspicious part which makes it fail is maybee the "run" parameter?

Node v6.11.4
NPM 3.10.10
Visual Studio 2017 (15.4.4)

@sgordon3
Copy link

sgordon3 commented Nov 22, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants