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

ANSI colours getting sent through as plain text (at least in windows)? #10

Open
Pomax opened this issue Jan 27, 2015 · 3 comments
Open

Comments

@Pomax
Copy link

Pomax commented Jan 27, 2015

When running files through gulp-jsxsc in a windows "cmd" terminal, gulp's coulor codes seem to work just fine, but the jscs output has its ANSI colour codes somehow showing up as literal text:

gulp.task('jscs-app', function() {
  var jsxcs = require("gulp-jsxcs");
  var jshint = require('gulp-jshint');
  return gulp.src(jscsSrc)
    .pipe(jsxcs())
    .pipe(jshint.reporter('default'));
});

yields:

screenshot 31

(The top few lines show gulp's colouring working correctly)

If I try to use .pipe(process.stdout) instead of .pipe(jshint.reporter('default')); errors occur that prevent logging entirely, so it's possible the stream is not quite conformant to what stdout data should look like, thus also messing up the default jshint reporter?

@agschwender
Copy link
Contributor

Works fine for me on Ubuntu, so not a super high priority for me, but I'll try to get to it when I can. If it's urgent for you, you're definitely welcome to contribute.

@agschwender
Copy link
Contributor

It's emitting an error, so I don't believe either of those reporters will work. I'm not using jshint to render the output of the task. Here's my gulp task:

// Enforce style rules for js
gulp.task('style:js', function() {
    var jsxcs = require('gulp-jsxcs');
    return gulp.src(paths.js)
        .pipe(jsxcs());
});

Not sure if that will solve the color issues for you, as even when I did run it through the jshint, the console still rendered the colors properly.

@Pomax
Copy link
Author

Pomax commented Jan 28, 2015

While that works as a stopgap measure, it's not a workable solution if stream needs be sent on for further analysis and/or logging =(

I suspect the fact that the colour codes show as literals, and the fact that node crashes if process.stdout is used instead, are both symptoms of the same underlying problem (something is sending on malformed data over the pipe, or is not yielding the correct stream to send on).

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

2 participants