Skip to content

delta pager option --detect-dark-light not working. #4550

Closed

Description

@andradei

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.

To Reproduce

lazygit/config.yml

gui:
  nerdFontsVersion: "3"
git:
  paging:
    colorArg: always
    pager: delta --detect-dark-light always --paging never

gitconfig

; ...
[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

Image

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

Activity

  1. pricci1 commented on Oct 29, 2025

    @pricci1

    +1 It would be great to support delta --detect-dark-light=always

    Header
    Delta's dark on Kitty's light:
    Image
    Delta's light on Kitty's dark:
    Image
    Delta's light on Kitty's light:
    Image

    For now I just settle with delta --light, that is usable, tough a bit bright when in dark theme

  2. dwt commented on Nov 11, 2025

    @dwt

    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
  3. dwt commented on Nov 11, 2025

    @dwt

    I see the same behavior on MacOS Tahoe with both the builtin Terminal, as well as the Terminal used in Zed

    ❯ sw_vers 
    ProductName:		macOS
    ProductVersion:		26.1
    BuildVersion:		25B78
    ❯ delta --version
    delta 0.18.2
    ❯ lazygit --version
    commit=, build date=, build source=nix, version=0.56.0, os=darwin, arch=arm64, git version=2.51.0
    
  4. stefanhaller commented on Nov 11, 2025

    @stefanhaller
    Collaborator

    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.

  5. patrik-csak commented on Nov 11, 2025

    @patrik-csak

    @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.

  6. lmdevv commented on Nov 20, 2025

    @lmdevv

    +1

    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.

  7. Lcchy commented on Dec 28, 2025

    @Lcchy

    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

  8. stefanhaller commented on Sep 27, 2026

    @stefanhaller
    Collaborator

    Addressed in #6063. Not by adding support for --detect-dark-light, but by supporting --{{colorScheme}}, which evaluates to "--dark" or "--light" and updates dynamically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions