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

Fix colors in console reporter, resolves #298 #369

Merged
merged 1 commit into from
May 19, 2023

Conversation

Bodigrim
Copy link
Collaborator

No need to be clever, just putStr :)

@Bodigrim Bodigrim requested a review from andreasabel May 18, 2023 22:19
@@ -709,7 +709,9 @@ ok, fail, skipped, infoOk, infoFail :: (?colors :: Bool) => String -> IO ()
fail = output failFormat
ok = output okFormat
skipped = output skippedFormat
infoOk = output infoOkFormat
-- Just default foreground color for 'infoOk'; do not apply 'infoOkFormat',
-- because terminal's background could be white itself. See #298.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that is the usual problem with coloring output.

We have the same problem when considering coloring errors for Agda.

It would be great to have symbolic colors, that resolve to physical color according to some (standard or custom) coloring scheme, depending on the background color.
I haven't found any Haskell solution to that problem yet (that at least works well on modern terminals).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I'm not aware of any fundamental solution. Other colors used by tasty are less problematic: it's highly unlikely that someone has a terminal with red or green background; it's only infoOkFormat who poses an issue.

Copy link
Collaborator

@andreasabel andreasabel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Of course I approve.

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.

Font color in some contexts might be indistinguishable from terminal foreground color
2 participants