alloy / kicker

A lean, agnostic, flexible file-change watcher, using OS X FSEvents.
https://rubygems.org/gems/kicker
Other
556 stars 26 forks source link

Colors in output #44

Open Manfred opened 11 years ago

Manfred commented 11 years ago

I think some test runners try to detect where they're writing to and possibly don't include ANSI colors when running through Kicker cough rspec cough. The problem is that output coming from Kicker is all black, and I like my colors.

How to reproduce: kicker -r ruby in any directory with specs. Change a file.

alloy commented 11 years ago

I agree that this would be nice. Basically, the stdin that’s passed to the spawned process should be a TTY.

PS I think you can pass the --color option to rspec and it will not perform the automatic check.

Manfred commented 11 years ago

Right, I tried --color, but it didn't work. This was with RSpec 1.2 though, so it might be better with newer versions.

raine commented 11 years ago

I'd like this.

Manfred commented 10 years ago

I'm experimenting with a PTY for version 4.0.

kylef commented 9 years ago

Most tools use the isatty to determine if it's a TTY and if so, uses ANSI (colour) codes. To support these tools by default, we would need to somehow make the subprocesses stdout and stderr file descriptors cause isatty to return 1 in the subprocess.

I'm kind stuck on how to go about this, but would love to make a pull request if anyone has an pointers how to go about this. @Manfred you mentioned experimenting with a PTY, did you get any success with this?

alloy commented 9 years ago

@kylef This is the PTY stdlib module, which should do the job: http://apidock.com/ruby/v1_9_3_392/PTY/spawn/class

Manfred commented 9 years ago

Yep: https://github.com/Manfred/Four/blob/master/lib/kicker/watcher.rb#L92

kylef commented 9 years ago

@Manfred Alright, not sure what the status of your separate "Four" repository. If I were to back port the PTY changes into a PR for the current kicker would this likely get merged/released?

Manfred commented 9 years ago

@kylef I created the fork because I didn't like all the dependencies on the watcher libraries. My branch has a slightly different implementation of Recipes so it's not compatible.

I think it's probably best to reverse implement features onto the 3.x version. So yeah, if you implement PTY we will merge and release.