SerenityOS / serenity

The Serenity Operating System 🐞
https://serenityos.org
BSD 2-Clause "Simplified" License
30.38k stars 3.18k forks source link

Colour schemes: Foreground and background "black" are not the same in the terminal #24961

Open algorithmwolf opened 2 weeks ago

algorithmwolf commented 2 weeks ago

@oskar-skog raises an interesting observation in #24955

The foreground and background "black" colour are not the same.

From their screenshot: image

However, this does not happen in Base16 Dark colour scheme:

image

But it does happen in many other colour schemes, including for example, the default one, as well as Monokai:

image

Is this expected behaviour?

nico commented 2 weeks ago

In Terminal.app's built-in "Silver Aerogel", the text is visible too:

image

(In most themes, it isn't.)

So I suppose this isn't a reliable way to draw invisible text.

(In Serenity's Terminal, if we were to implement concealing by setting the foreground color to the background color, we'd set the foreground color to the actual background color, and this wouldn't be an issue. But it's a moot point now that we didn't implement it that way.)

algorithmwolf commented 2 weeks ago

Then I have to wonder: Why do so many terminal libraries implement concealed text this way?

It appears to me it wouldn't even be a matter of performance: My implementation completely ignores drawing characters, and should be much faster, and yet we see st and iTerm doing concealed text with colours :thinking: