Radare2: fe6f9badb Breaks truecolor

Created on 8 Sep 2018  路  6Comments  路  Source: radareorg/radare2

Work environment

| Questions | Answers
|------------------------------------------------------|--------------------
| OS/arch/bits (mandatory) | Fedora x64
| File format of the file you reverse (mandatory) | N/A
| Architecture/bits of the file (mandatory) | N/A
| r2 -v full output, not truncated (mandatory) | N/A

Expected behavior

r2 detects and uses truecolor appropriately

Actual behavior

r2 appears to fall back to non-truecolor

Steps to reproduce the behavior

  • start current fe6f9badb in gnome-terminal. See the ugly bright colors.

Additional Logs, screenshots, source-code, configuration dump, ...

fe6f9badb vs 9fd8f5068

image

bug consoleui

Most helpful comment

Hi. I'm the guy who made scr.color be the correct value.
The theme looks like it should from my perspective.
It just didn't look like it before.

Since the 16-color-having console default needed to downscale, it fits the colors given into 16, which are probably themed on your terminal.
So this is not a bug IMO, but expected behaviour.

All 6 comments

can you please provide the output of e scr.color as soon as you start r2 on gnome-terminal on f36f9ba?

Hi,

           scr.color: Enable colors (0: none, 1: ansi, 2: 256 colors, 3: truecolor)

Before https://github.com/radare/radare2/commit/fe6f9badb5f11cfa2a1c71fcd2132deea201928f e scr.color was set to 1.

So what is happening here is that on the left, scr.color is set to 3 because it detected your terminal supports Truecolor (and as you can see, it works, otherwise you would see a very broken view of the hexdump).
Now on the right, scr.color is set to 1 so it prints ansi colors, and that's why the yellow is not completely yellow.

If what I am saying is true, there's no issue and we can close this issue.
If not, let me know.

yes, it seems to be the opposite. The problem is that the default theme doesn't work with truecolor.

What do you mean it doesn't work with truecolor?
What is the meaning of "work"?
It works very fine, it's just that by default the colors are compressed.
Now if you want it to look like scr.color=1 when scr.color=3 you have to modify the color codes in the theme so it fits the compressed colors by ansi codes.

In any case, you can set e scr.color=1 into your ~/.radare2rc file so you can avoid that.

Hi. I'm the guy who made scr.color be the correct value.
The theme looks like it should from my perspective.
It just didn't look like it before.

Since the 16-color-having console default needed to downscale, it fits the colors given into 16, which are probably themed on your terminal.
So this is not a bug IMO, but expected behaviour.

Was this page helpful?
0 / 5 - 0 ratings