zsh-users / zsh-syntax-highlighting

Fish shell like syntax highlighting for Zsh.
github.com/zsh-users/zsh-syntax-highlighting
BSD 3-Clause "New" or "Revised" License
19.5k stars 1.32k forks source link

fix comments being invisible in certain conditions #920

Closed Silejonu closed 10 months ago

Silejonu commented 1 year ago

When setopt interactivecomments is set, comments become invisible in a black terminal. This commit fixes it by adding a magenta background.

Of course the choice of colour is debatable, I went with what made the most sense to me.

fg=black could also be removed entirely, so that the text is in the same colours as the default text.

Fixes #510

danielshahaf commented 1 year ago

Making z-sy-h not use "bold black" doesn't seem like the right fix to me, anyway, since any other application may use "bold black" as well. I'd sooner recommend to configure your terminal emulator so as many colour combinations as possible are readable.

Indeed, "black" and "bold black" are usually rendered with different RGB values (#000000 for the former, some shade of grey for the latter). That's what xterm(1) does by default, for example. What terminal emulator do you use? What does print -P %F{black}%Blorem ipsum%f%b look like in it? And echo $'\e[90mlorem ipsum\e[0m'? (I don't have handy the symbolic name for this color, if any)

Silejonu commented 1 year ago

any other application may use "bold black" as well.

But from my experience, none has ever done that in practice, for good reasons.

I use GNOME Console and GNOME Terminal. The issue is present on both.

Here is the output of the commands your wrote:

phy1729 commented 10 months ago

I'm reluctant to change the default as it's been this way for nearly 8 years. Changing it now (especially from a relatively muted bold black to a rather loud magenta background) would be a breaking change for anyone who relies on the default. The default won't be able to please everyone, but that's why the styles are configurable :slightly_smiling_face:.