Hacker News new | ask | show | jobs
by sunshowers 334 days ago
I think jj just uses the 4 bit (16 color) terminal palette, so if a color is unreadable, you can update your terminal theme accordingly.
3 comments

This has been the case, but it's worth noting that very recently, support for theming with the 256-color palette has landed too https://github.com/jj-vcs/jj/pull/6763
Cool! Don't imagine it would ever be the default, though.
I hope not, for sure.
Jjui is by far the best TUI for jj and just released a Themes feature yesterday. It's well worth checking out.

https://github.com/idursun/jjui

Some programs set the background colour and some don't. For example pamix sets the background to black, or tmux's statusline, or ngrok. It's not really possible to define one terminal scheme that always works.
You can also configure jj to use whichever colors you'd like, in either the 16 or 256 color space: https://jj-vcs.github.io/jj/latest/config/#custom-colors-and...
Of course! But why even bother when everything I have to do I can do with git without any problems?
I never said you should. If you like git, use git. One of the nicest things about jj is that it doesn't require others to use it.
I think it's reasonable to assume that all 12 colors that aren't black or white will be readable on the default terminal background. I sympathize with those for whom that isn't true, but please do find a different theme in that case.
How would that work with applications that hard-code the background to black (or some other colour, like tmux's green statusline)? If you change the colours to work on a light background then those break.

You have to choose what you want to break. Once you start pulling on one thread lots of stuff start to unravel. It's really not a simple matter of "choosing a better theme".

I've spent a long time looking at this, and my conclusion is that there is no safe default that will work for everyone, other than bold/reverse and 256/true colours and setting both the foreground and background.

If you hardcode the background to a fixed color, the 4-bit palette for foreground colors is generally to be avoided -- instead, use the 8-bit (256 color) or bigger palettes.
I don't control these applications.
If I understand correctly, you're in the situation where you've chosen your 4-bit colors so that they render properly on an application which (incorrectly) uses an 8-bit background color but a 4-bit foreground color, and also that the colors don't render well on the default background that's part of the same 4-bit palette.

I think you'd be a great candidate for jj's ability to customize colors.

What situation do you have where jj is rendering colored text on top of a background you don't control? I'm perplexed.
So do you suggest we should avoid setting a color in our CLI app? We would take this into consideration in our next pinggy.io CLI update.