dandavison / delta

A syntax-highlighting pager for git, diff, grep, and blame output
https://dandavison.github.io/delta/
MIT License
21.34k stars 359 forks source link

Option to detect the dark theme from the OS instead of terminal #1661

Open kornelski opened 3 months ago

kornelski commented 3 months ago

I've added an alternative light/dark theme detection mechanism for macOS. It checks the global theme setting, which doesn't require any special terminal support, assuming the terminal application follows the OS theme too.

bash commented 3 months ago

Hi @kornelski 👋🏼 It's really cool to see someone continuing on top of my PR :)

What's the reason for detecting the color scheme from the OS instead of the terminal?

If you have any feedback for the terminal color detection I'd love to know 😀

If it's about the latency of the terminal detection then I totally understand; some terminals take quite a moment to answer 😅

kornelski commented 3 months ago

The reason is that it's completely terminal-independent, so it can work when piping to a non-terminal, or when the terminal itself doesn't support detection.