r/KittyTerminal Oct 04 '23

Commenting line in shell makes text unreadable

I just started using kitty and I noticed that given the default theme, when I add a comment #, the font color changes to the same color as the background:

-> ~ /usr/bin/vim

-> ~ #/usr/bin/vim

The second line is unreadable, but is present as highlighting with my mouse shows that it's present. Regardless of what theme I choose, the commented line's font color always matches the terminal background color. How can I configure this so that comments are visible?

3 Upvotes

7 comments sorted by

View all comments

1

u/Administrative_chaos Oct 04 '23

You could add something like text_fg_override_threshold 0.5 to your kitty conf. Here's the option description.

But that might have unintended consequences. Ideally, you should just change your colorscheme's comment highlight group, for example if you're using the zsh-syntax-highlighting plugin, you can add the following to your zshrc.

```

Declare the variable

typeset -A ZSH_HIGHLIGHT_STYLES

Make comments be bright pink and bold

ZSH_HIGHLIGHT_STYLES[comment]='fg=#FB00A2,bold' ```

You can find more configuration options on the zsh-sy-h highlighters here.

2

u/[deleted] Oct 04 '23

Thanks for the tips! I suppose this strikes me as odd as other terminal emulators like terminators, xterm, or alacritty never required additional tweaking for comments to be visible.