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

request to support CLI_COLORs :-) #217

Closed
colin-kiegel opened this issue Oct 30, 2015 · 11 comments
Closed

request to support CLI_COLORs :-) #217

colin-kiegel opened this issue Oct 30, 2015 · 11 comments

Comments

@colin-kiegel
Copy link
Contributor

Some build tools support colored output like rust cargo. I gave this a try with atom-build, but the color seems to be ignored by atom-build.

@jhasse FYI

What I tried is the following:

@jhasse
Copy link
Contributor

jhasse commented Oct 30, 2015

Thanks for pinging me :)

I have a PR for Rust which would make this work: rust-lang/rust#27867
After the pull request if CLICOLOR_FORCE is set to 1, rustc will display the correct color codes for atom-build.
Regarding the environment variable: http://bixense.com/clicolors/

But in atom-build these color codes are stripped somewhere along the way to the output panel. I only get unformatted text as usual.

Maybe this has something to do with #159?

@colin-kiegel
Copy link
Contributor Author

Hmm .. I disabled autoscrolling, but still don't get colored output. If I understand noseglid correctly CLI_COLORs are currently not supported - so even if colored output would be improved on the rust side by rust-lang/rust#27867 atom-build could not deal with it right now (if I understand correctly).

NOTE that cargo already supports colored output. You can try

  • cargo test | less => no color
  • cargo test --color always -- --color always | less => color

@jhasse
Copy link
Contributor

jhasse commented Oct 30, 2015

They are definitely supported (on Linux)! I'm using it with cmake for example. Have you tried something simple like python -c "print '\x1b[1;31mred'"?

@jhasse
Copy link
Contributor

jhasse commented Oct 30, 2015

bildschirmfoto vom 2015-10-30 16-39-59

@colin-kiegel
Copy link
Contributor Author

This is strange - but you are right, your python code produces colored output. It seems to be some strange cargo bug - if I write colored output of cargo into a file and cat that into atom-build it prints colors. Looks like cargos --color flag doesn't work when called from atom-build. Just weird.

@jhasse
Copy link
Contributor

jhasse commented Oct 30, 2015

Can you try only rustc with the --color flag?

cargo handles colors a little differently from rustc afaik.

@noseglid
Copy link
Owner

@colin-kiegel The reason is probably that cargo (like most applications) determine if there is a tty connected to stdout. If it is not (which is the case when piping data into cat, or run via build) cargo will not print colors. Very often there are switches which enable colors (maybe --color as suggested by @jhasse .

@evmorov
Copy link
Contributor

evmorov commented Feb 4, 2016

I had a similar issue with RSpec. You should call it rspec --tty to have colors.

@placrosse
Copy link

Could an option, similar to that for --verbose, be added so cargo output is forced to emit the colors?

@noseglid
Copy link
Owner

noseglid commented Aug 11, 2016

That should be opened on the build cargo repo

On tors 11 aug. 2016 at 06:47, Paul LaCrosse notifications@github.com
wrote:

Could an option, similar to that for --verbose, be added so cargo output
is forced to emit the colors?


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#217 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AA4_-FrW6qgxgUnT5civ4PVVveBDU6r8ks5qeqlmgaJpZM4GZDrc
.

@alygin
Copy link
Contributor

alygin commented Aug 13, 2016

The PR for build-cargo: AtomBuild/atom-build-cargo#57

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

6 participants