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 always races with bubbletea's input reader
Same root cause as jesseduffield/lazygit#4550.
Related: #5, #86, #89
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
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--detect-dark-light alwaysraces with bubbletea's input readerSame root cause as jesseduffield/lazygit#4550.
Related: #5, #86, #89
To Reproduce
echo "" | delta— correct light colorsgit diff HEAD~1 | diffnav— dark colors, poor contrastExpected behavior
Diffs should match the terminal's actual background. Bubbletea v2 provides
tea.RequestBackgroundColor()which queries OSC 11 during init and deliversBackgroundColorMsgwith.IsDark(). diffnav can pass--dark/--lightto 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):