Skip to content

Conversation

@gkampitakis
Copy link
Owner

@gkampitakis gkampitakis commented Feb 19, 2025

Closes #122

@silverwind
Copy link

I recommend using something like https://github.com/jwalton/go-supportscolor. This is for example useful on CI environments like GitHub Actions which can display color while not setting the TERM variable.

@gkampitakis
Copy link
Owner Author

Hey @silverwind unfortunately I don't think even your suggestion would do the trick to detect if the go test is running in a terminal that supports color. This pr is me exploring a solution, also #122 (comment)

@silverwind
Copy link

Sounds like the stdout you see in tests is not the real one? Yeah it's hard if that's the case.

@silverwind
Copy link

Maybe just always output color except when NO_COLOR is in env or TERM=dumb? Most environments these days support color, and stripping of control characters is always possible when needed.

@gkampitakis gkampitakis force-pushed the automatic_no_color branch 2 times, most recently from d0ef4bf to 9f7b58d Compare November 2, 2025 10:43
@gkampitakis gkampitakis marked this pull request as ready for review November 2, 2025 10:43
@gkampitakis gkampitakis merged commit 355adfe into main Nov 2, 2025
7 checks passed
@gkampitakis gkampitakis deleted the automatic_no_color branch November 2, 2025 11:01
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.

[Feature Request]: Turn off color automatically

3 participants