deno_std icon indicating copy to clipboard operation
deno_std copied to clipboard

restore background highlight in diff of assertEquals

Open kt3k opened this issue 2 years ago • 5 comments

We temporarily disabled background highlight in diff of assertEquals (#2601) as it's very hard to see in certain terminals

We used to use bgGreen and white combination for that highlight. It's enough visible in some terminals, but it's not in some others. (See #2575 for example)

kt3k avatar Sep 02 '22 11:09 kt3k

One solution might be to use true color coloring when the terminal supports it, and fallback to ansi color when no support of it

Note: supports-color npm module seems doing this detection

kt3k avatar Sep 02 '22 11:09 kt3k

So I could only check if the terminal supports true color and if it does I can color it with bgGreen and white and if it doesn't leave it uncolored?

luk3skyw4lker avatar Sep 03 '22 01:09 luk3skyw4lker

The issue happens on some terminals with ansi colors (green, bgGreen, etc). To avoid that if the terminal supports true color then we should use color code (like 006400 for green, for example), and if it doesn't, we fallback to ansi colors (green, bgGreen, etc)

kt3k avatar Sep 03 '22 07:09 kt3k

I'll take a stab at this one then. I'll be trying to open a PR next weekend

luk3skyw4lker avatar Sep 03 '22 18:09 luk3skyw4lker

This becomes trivial when https://github.com/denoland/deno/pull/18549 lands.

lino-levan avatar Sep 09 '23 03:09 lino-levan