I use different terminals, some with black font on light background, others with white font on black background. It is very hard to read the output of several themes on terminals with light background colour. It would be helpful if bat could autodetect this and invert colors (or give the printed lines a background color.
I don't think there is a reliable way to detect the terminals background color (https://stackoverflow.com/questions/2507337/is-there-a-way-to-determine-a-terminals-background-color), so this is probably not going to happen.
So the way to go would be to explicitly set the background color for each line.
Anyway, thanks a lot for your work!
I have tried that, but it looks terrible because the background color changes in the middle of your terminal session. I wouldn't want any CLI program to do that. You also need to do things like filling short lines with spaces just to "draw" the background color.
can you add a light/dark flag to control the theme? I use solarized light and white text is unusable on it
update:
try bat --list-themes to see themes you may like, for me GitHub and Monokai Extended Light work.
use like bat --theme GitHub file.txt
@morenoh149 Please take a look at all the themes in bat --list-themes. There are many themes for light terminal schemes (GitHub, Monokai Extended Light, OneHalfLight). Then just use --theme or the BAT_THEME environment variable.
Most helpful comment
I have tried that, but it looks terrible because the background color changes in the middle of your terminal session. I wouldn't want any CLI program to do that. You also need to do things like filling short lines with spaces just to "draw" the background color.