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

only enable colors when output to a terminal (not to a file) #1458

Merged
merged 1 commit into from
Oct 6, 2014
Merged

only enable colors when output to a terminal (not to a file) #1458

merged 1 commit into from
Oct 6, 2014

Conversation

remicollet
Copy link
Contributor

No description provided.

@remicollet remicollet mentioned this pull request Oct 6, 2014
sebastianbergmann added a commit that referenced this pull request Oct 6, 2014
only enable colors when output to a terminal (not to a file)
@sebastianbergmann sebastianbergmann merged commit adc637c into sebastianbergmann:4.4 Oct 6, 2014
@sebastianbergmann sebastianbergmann added this to the PHPUnit 4.4 milestone Oct 6, 2014
@remicollet
Copy link
Contributor Author

Thanks :)

@jameshalsall
Copy link

@sebastianbergmann I'm -1 for this, it doesn't work reliably. For example the jenkins console supports colours using a plugin and not natively.

If people want to turn colours on, let them turn them on rather than saying they can't

@GrahamCampbell
Copy link
Contributor

I like this. Very hepful on windows. It means I don't need to keep modifying my config each time I clone a repo.

@henriquemoody
Copy link
Contributor

Also it's useful if you want to pipe the output.

@jameshalsall
Copy link

I also think this is affecting part of this user's problem #1523

In addition it does not seem to pick up the color="true" setting from our phpunit.xml anymore but that's a different issue.

@GrahamCampbell
Copy link
Contributor

That's unlikely.

@jbladen
Copy link

jbladen commented Dec 12, 2014

Why not handle this in the same way ls does on *nix systems? Keep the --color flag but use the following arguments, with logical behaviour:

  • ‘always’, ‘yes’, ‘force’
  • ‘never’, ‘no’, ‘none’
  • ‘auto’, ‘tty’, ‘if-tty’

And have it default to "none".

@henriquemoody
Copy link
Contributor

I was thinking about the same thing @jbladen.

@jameshalsall
Copy link

@jbladen great idea

@Fludimir
Copy link

Looks like this commit breaks colors display when running on windows in cygwin terminal

@GrahamCampbell
Copy link
Contributor

@Fludimir Lots of things have changed since this.

@Fludimir
Copy link

May be, but after update from phpunit 4.3.5 to 4.4.1 colors aren't displayed in console and probably no way to display it.

@GrahamCampbell
Copy link
Contributor

Yeh, try out phpunit alpha, 4.6.x. It's got the new behaviour in.

@Fludimir
Copy link

Tried, works only with --colors=always in console. So the only way to display colors in cygwin console will be to manually add this option each run?

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.

7 participants