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

[cross_platform_cmd] Albacore 2.0 doesn't support colored console #99

Open
rprouse opened this issue Feb 27, 2014 · 8 comments
Open

[cross_platform_cmd] Albacore 2.0 doesn't support colored console #99

rprouse opened this issue Feb 27, 2014 · 8 comments

Comments

@rprouse
Copy link

rprouse commented Feb 27, 2014

I was evaluating both 1.0 and 2.0 to wrap msbuild and nunit tests. Colored output from msbuild worked fine in 1.0, but in 2.0 it was just the default console color. It isn't a major problem, but it does make it difficult to pick out errors or warnings. Am I doing something wrong, or is that expected?

@haf
Copy link
Member

haf commented Feb 27, 2014

It's not expected; it has to do with how we wrap the operating system invocation. I haven't been able to find a good resource on why or how the colouring is decided. I'd very much welcome help.

@rprouse
Copy link
Author

rprouse commented Feb 27, 2014

If I get a chance, I will take a look, although my Ruby skills are very rusty. I recently added colorization to the nunit-console and was disappointed when it disappeared again :) We are considering using albacore to build NUnit v3. If we do, it will give me more excuses to dive into this code.

@haf
Copy link
Member

haf commented Feb 27, 2014

Here is the line of code. I'm interleaving output from the error stream and the output stream, while saving it in memory so I can print it later. Perhaps the colourization is an option on a stream?

@haf
Copy link
Member

haf commented Feb 27, 2014

You might also be interested in using my ultimate process management branch, which uses #select. It's taken from the foreman gem and my aim is to allow background tasks to spawn while doing tests, e.g. to spawn a web server while running integration nunit tests.

@haf haf added the help wanted label Aug 1, 2014
@haf haf added this to the v2.1 Release milestone Aug 1, 2014
@haf haf changed the title Albacore 2.0 doesn't support colored console [cross_platform_cmd] Albacore 2.0 doesn't support colored console Dec 2, 2014
@tgeens
Copy link

tgeens commented Apr 17, 2015

I think it's related to tty-detection by the child process ?

Using IO.pipe as stdout will disable colored ansi output:

>> read,write = IO.pipe
=> [#<IO:fd 11>, #<IO:fd 12>]
>> write.isatty
=> false

Using Albacore.application.output however, seems suitable:

>> require('albacore')
=> false
>> Albacore.application.output.isatty
=> true

If I replace :out => write by :out => Albacore.application.output I do get colored output ... but I'm most probably breaking other stuff ...

@haf
Copy link
Member

haf commented Apr 17, 2015

Do the tests pass? You might be breaking output capture and therefore pattern matching.

@vicp-iq
Copy link

vicp-iq commented Jun 9, 2016

Seems like this is still active. Is the V2.2 milestone still a work in progress?

@haf
Copy link
Member

haf commented Jun 13, 2016

@vicp-iq Yes, but there's no funding currently, so it's PR based.

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

No branches or pull requests

4 participants