You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Delta always defaults to dark mode — terminal background detection broken #119
Run git diff HEAD~1 | diffnav — dark colors, poor contrast
Expected behavior
Diffs should match the terminal's actual background. Bubbletea v2 provides tea.RequestBackgroundColor() which queries OSC 11 during init and delivers BackgroundColorMsg with .IsDark(). diffnav can pass --dark/--light to delta based on this.
I have an implementation with tests ready if you'd like a PR.
Screenshots
N/A
Desktop (please complete the following information):
Thanks for the detailed explanation and the pointer to tea.RequestBackgroundColor() / BackgroundColorMsg.IsDark() — that was really helpful to understand the root cause.
I’m also hitting this on a light terminal and getting poor contrast with dark‑mode deltas inside diffnav.
If automatically detecting the terminal background via Bubbletea is not a quick fix, would you be open to adding a smaller, intermediate step to let users control the delta theme explicitly?
For example:
A config option like delta_theme = "dark" | "light" in diffnav’s config, or
A CLI flag like --delta-theme=dark / --delta-theme=light, or
A way to pass extra args to delta (e.g. delta_args = "--light --paging=never"), so we can force --dark / --light from the outside.
This wouldn’t fix the auto‑detection issue, but it would unblock users who are okay with manually matching their terminal theme, without having to wrap or modify delta themselves.
Totally understand if you’d rather hold out for the “proper” Bubbletea‑based solution, but I figured I’d suggest a simpler escape hatch in case it’s easy to add and helps people in the meantime.
Thanks again for diffnav — aside from this light‑mode issue it’s been really nice to use.
Activity
huyz commentedon Apr 2, 2026
Hmm, I think I have the opposite problem. My diffnav seems to think the terminal is in light mode but I'm in dark mode.
BrahmingWu commentedon May 23, 2026
Thanks for the detailed explanation and the pointer to
tea.RequestBackgroundColor()/BackgroundColorMsg.IsDark()— that was really helpful to understand the root cause.I’m also hitting this on a light terminal and getting poor contrast with dark‑mode deltas inside diffnav.
If automatically detecting the terminal background via Bubbletea is not a quick fix, would you be open to adding a smaller, intermediate step to let users control the delta theme explicitly?
For example:
delta_theme = "dark" | "light"indiffnav’s config, or--delta-theme=dark/--delta-theme=light, ordelta_args = "--light --paging=never"), so we can force--dark/--lightfrom the outside.This wouldn’t fix the auto‑detection issue, but it would unblock users who are okay with manually matching their terminal theme, without having to wrap or modify delta themselves.
Totally understand if you’d rather hold out for the “proper” Bubbletea‑based solution, but I figured I’d suggest a simpler escape hatch in case it’s easy to add and helps people in the meantime.
Thanks again for diffnav — aside from this light‑mode issue it’s been really nice to use.
dlvhdr commentedon Aug 21, 2026
Can you check with the latest main?
I added theme support in #152