-
-
Notifications
You must be signed in to change notification settings - Fork 30
Delta always defaults to dark mode — terminal background detection broken #119
Copy link
Copy link
Open
Description
Describe the bug
Delta always renders with dark mode colors inside diffnav, even on light terminal backgrounds. Standalone delta detects correctly.
Delta's detection sends OSC 11 to the terminal and reads the response. Inside diffnav this fails because:
diffFile()/diffDir()pipe delta's stdout to a buffer —is_terminal()returns false, detection skips, defaults to dark- bubbletea owns the terminal in raw mode, so even forcing detection via
--detect-dark-light alwaysraces with bubbletea's input reader
Same root cause as jesseduffield/lazygit#4550.
To Reproduce
- Set terminal to a light background
- Run
echo "" | delta— correct light colors - 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):
- OS: Mac
- Version: v0.11.0
- Terminal Emulator: Ghostty
- Using tmux? Reproducible with and without
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels