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

Don't print \r if we're not connected to a terminal. #53

Merged
merged 1 commit into from
Apr 13, 2015

Conversation

smspillaz
Copy link
Contributor

If stdout is connected to a pipe or file, this will result in
duplicate lines.

Check to make sure we're connected to a terminal first before
printing \r and other "status" like lines.

Fixes #52

If stdout is connected to a pipe or file, this will result in
duplicate lines.

Check to make sure we're connected to a terminal first before
printing \r and other "status" like lines.

Fixes CleanCut#52
@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling f10d166 on smspillaz:fix-52 into d56a0c7 on CleanCut:master.

@CleanCut
Copy link
Owner

This seems like good logic for when we're auto-detecting whether or not to use color. What about the case when the user specifies -t/--termcolor to force colors on regardless of whether or not green is attached to a terminal?

@CleanCut
Copy link
Owner

Oh, wait. This doesn't disable colors. It disables the first line that gets rewritten once the test finishes. Sorry for being a bit slow on the uptake.

CleanCut added a commit that referenced this pull request Apr 13, 2015
Don't print \r if we're not connected to a terminal.
@CleanCut CleanCut merged commit 04e7783 into CleanCut:master Apr 13, 2015
@CleanCut
Copy link
Owner

Included in 1.9.1 released just now.

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

Successfully merging this pull request may close these issues.

Don't print \r if we're not connected to a terminal
3 participants