-
Notifications
You must be signed in to change notification settings - Fork 36
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
use ansi-to-html to get colored output #9
Conversation
One thing I did run into when I was testing with it last night was that it We should probably also make the default text color in our pane a little On Tue, May 20, 2014 at 9:08 AM, Moxley Stratton
|
I wanted to implement this too. But after seeing no colors and reading nodejs/node-v0.x-archive#2754 I eventually gave up. I just tried your branch and saw no colors at first. Adding |
FYI: Adding |
@@ -13,7 +14,7 @@ class RubyTestView extends View | |||
@span outlet: 'header' | |||
@div class: "panel-body", => | |||
@div class: 'ruby-test-spinner', 'Starting...' | |||
@pre "", outlet: 'results' | |||
@div "", outlet: 'results' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using a pre
tag renders just fine and is indented too (and the text is brighter for me too). I'd revert this.
@calmyournerves I tried your suggestion with Maybe there is something that can be passed to the running process to fool it into thinking it's being run from a terminal? Something like this: http://stackoverflow.com/questions/1401002/trick-an-application-into-thinking-its-stdin-is-interactive-not-a-pipe. |
@moxley I tried https://github.com/chjj/tty.js last time and it showed colors, but it seems like a pretty complicated solution for this problem. |
@calmyournerves: Yeah, tty.js looks like a full terminal emulator. I use |
Basically all of my projects (open source and at work) specify config.color On Tue, May 20, 2014 at 3:40 PM, Moxley Stratton
|
@calmyournerves I switched the div back to a pre and it does look a lot better. If we make the default rspec commands just include |
Yeah @hqmq, it seems strange that Rspec doesn't blindly take what you specify for the Any way, adding documentation will work for now. But eventually, I'd like for users to not have to add special configuration to get colors they're already used to seeing. It's possible. I prepended the test command with the Totally on a different subject, this PR introduces a new problem. The output is left unescaped, so special HTML characters like |
oh, that is interesting. The ansi-to-html library emits html, so I had to switch to using innerHTML rather than escaping it, I wonder if there is a way to get the ansi-to-html library to escape html characters as it is processing the data stream |
Now that I think about it, that sounds like a bug in ansi-to-html. |
I've got a pull request into ansi-to-html, once that gets merged and released we should be able to just pickup the new package version and run with it. |
@moxley ansi-to-html released an update that included my escaping code. I've integrated it here. Perhaps I should write a specific test case for it? I wasn't sure, since it is really the responsibility of ansi-to-html. |
Looks great. I don't think a test is necessary for this. It's a visual enhancement rather than a functional one. And I agree about the HTML escaping bit-- since it's part of ansi-to-html, we shouldn't test it. |
use ansi-to-html to get colored output
It turns out zeus does pass options on to rspec, or at least it does with "--tty" and "--color". So, no more requiring tweaks to spec_helper.rb. Also, I'm going to change the default rspec command and add "--tty --color" to the command. |
Probably also useful to note that as of RSpec 3.0 there is an HTML On Fri, Jun 6, 2014 at 5:55 PM, Moxley Stratton notifications@github.com
|
This addresses issue #8
This is my very first attempt to contributing anything to atom (actually my first attempt to do anything with node.js at all) so all feedback is welcome. The current test suite runs for me, but the spec about the resize handle is failing on the current master branch.
I didn't write any tests for my code since I literally have no idea what I am doing, but if you are inclined to merge this I would be happy to go back and be more thorough.
This is what the output looks like for me right now: