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

Using --color on with prove doesn't force color when sent to a non-tty #115

Open
scottchiefbaker opened this issue Jan 23, 2023 · 3 comments

Comments

@scottchiefbaker
Copy link

scottchiefbaker commented Jan 23, 2023

I like to keep a tab open that runs my unit tests repeatedly. When I've made changes I can switch to that tab and see the current results of all my tests. Coloring green or red makes it really easy to know if I've broken something. I tried running prove inside of a continuous watch like so:

watch --color 'prove --color t/*.t'

It appears that prove attempts to be smart and not output ANSI if the target isn't a TTY. This can also be shown with:

prove --color t/*.t > /tmp/output.txt
@Leont
Copy link
Member

Leont commented Jan 23, 2023

Yeah, it's only willing to do color when in console mode. You can force that by setting HARNESS_OPTIONS=fTAP-Formatter-Console

@scottchiefbaker
Copy link
Author

A --color force option would be very handy here. I guarantee I won't remember that command above :)

@Leont
Copy link
Member

Leont commented Jan 23, 2023

To be honest this area is a mess, you can' get color without getting the console updates (if you're also using multiple jobs). Fixing this to work properly is a "patches welcome" kind of thing.

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

2 participants