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

Color codes are still being output when piped to other programs #1296

Closed
mcandre opened this issue Jul 30, 2014 · 3 comments
Closed

Color codes are still being output when piped to other programs #1296

mcandre opened this issue Jul 30, 2014 · 3 comments

Comments

@mcandre
Copy link

mcandre commented Jul 30, 2014

When I pipe mocha | less, ugly color code symbols are showing up:

mocha | less
ESC[0mESC[0m
ESC[0m  regenboogESC[0m
ESC[0m    dbESC[0m
^M    ESC[32m  ✓ESC[0mESC[90m store and retrieve password ESC[0m


ESC[92m ESC[0mESC[32m 1 passingESC[0mESC[90m (17ms)ESC[0m

Good etiquette for command line programs is to hide color codes when a TTY is not attached. jshint and ack behave correctly, for example.

I'm using the following system specs, in case this is an error in my personal configuration.

$ specs mocha node bash os
Specs:

specs 0.8
https://github.com/mcandre/specs#readme

mocha --version
1.21.3

npm --version
1.3.24

node --version
v0.10.25

bash --version
GNU bash, version 4.3.11(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 14.04.1 LTS
Release:    14.04
Codename:   trusty
@ethankao
Copy link

I'm not sure if this is related. When I use -C option, the color code is still printing.

@lo1tuma
Copy link

lo1tuma commented Aug 4, 2014

I can confirm this, -C or --no-colors does not work with mocha 1.21.3.

@boneskull
Copy link
Contributor

Problem appears in changeset a886ed9

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

4 participants