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 pager option --detect-dark-light not working. #4550
Describe the bug
Using delta as a pager, it will default to dark theme unless using delta --light,
and event --detect-dark-light always is ignored. Also, delta auto-detects dark/light terminal colors by default and omitting --light/--dark from lazygit config.yml still defaults to dark theme pager.
; ...[delta]navigate = true
line-numbers = true
side-by-side = true
whitespace-error-style = 22 reverse
; could also have `detect-dark-light = always` and lazygit is not picking it
Expected behavior
lazygit uses the delta behavior of auto-detecting dark/light theme.
Screenshots
Notice dark theme on the pager area of lazygit
Version info:
❯ lazygit --version
commit=v0.50.0, build date=2025-05-04T07:59:01Z, build source=binaryRelease, version=0.50.0, os=linux, arch=amd64, git version=2.49.0
_Run `git --version` and paste the result here_
❯ git version
git version 2.49.0
For what it's worth, it is possible to detect light or dark mode by asking the system, e.g. defaults read -g AppleInterfaceStyle which returns either nothing (light mode) or Dark for dark mode. Alternatively this AppleScript Snippet works too:
❯ osascript -e 'tell application "System Events" to tell appearance preferences to get dark mode'| grep -q true&&echo Dark ||echo Light
Dark
~
❯ osascript -e 'tell application "System Events" to tell appearance preferences to get dark mode'| grep -q true&&echo Dark ||echo Light
Light
There's a workaround for supporting automatic light/dark switching with delta on macOS: #4366 (comment)
Building support for this into lazygit is likely a lot of work, and I'm not really sure it's worth it. But maybe that's because I don't understand why anybody would want to switch dark/light automatically; I prefer my terminal (and IDE) to be always dark. Personal preference, I know.
@stefanhaller To answer that question for my use case, I use DarkModeBuddy to automatically switch between dark and light mode based on ambient light. This means that I switch between dark and light mode from a few times a day to a few times an hour.
When I try git diff where git is configured to use delta pager, it works on both light and dark mode, but when checking diff in lazygit it defaults to dark mode.
Addressed in #6063. Not by adding support for --detect-dark-light, but by supporting --{{colorScheme}}, which evaluates to "--dark" or "--light" and updates dynamically.
Reacted by Lennart, Patricio Serrano, Donato Aguirre, Isaac de Andrade and Karim Knaebel
Activity
pricci1 commentedon Oct 29, 2025
+1 It would be great to support
delta --detect-dark-light=alwaysFor now I just settle with
delta --light, that is usable, tough a bit bright when in dark themedwt commentedon Nov 11, 2025
For what it's worth, it is possible to detect light or dark mode by asking the system, e.g.
defaults read -g AppleInterfaceStylewhich returns either nothing (light mode) orDarkfor dark mode. Alternatively this AppleScript Snippet works too:dwt commentedon Nov 11, 2025
I see the same behavior on MacOS Tahoe with both the builtin Terminal, as well as the Terminal used in Zed
stefanhaller commentedon Nov 11, 2025
There's a workaround for supporting automatic light/dark switching with delta on macOS: #4366 (comment)
Building support for this into lazygit is likely a lot of work, and I'm not really sure it's worth it. But maybe that's because I don't understand why anybody would want to switch dark/light automatically; I prefer my terminal (and IDE) to be always dark. Personal preference, I know.
patrik-csak commentedon Nov 11, 2025
@stefanhaller To answer that question for my use case, I use DarkModeBuddy to automatically switch between dark and light mode based on ambient light. This means that I switch between dark and light mode from a few times a day to a few times an hour.
lmdevv commentedon Nov 20, 2025
+1
When I try
git diffwhere git is configured to use delta pager, it works on both light and dark mode, but when checking diff in lazygit it defaults to dark mode.Lcchy commentedon Dec 28, 2025
FYI the underlying issue is that the pagers get executed in a PTY that does not let OSC messages through.
Ref:
#3419
https://github.com/jesseduffield/lazygit/blob/master/pkg/gui/pty.go
fix: delta color theme in lazygit
stefanhaller commentedon Sep 27, 2026
Addressed in #6063. Not by adding support for
--detect-dark-light, but by supporting--{{colorScheme}}, which evaluates to "--dark" or "--light" and updates dynamically.