delta icon indicating copy to clipboard operation
delta copied to clipboard

🐛 Light/Dark Theme detection doesn't work in lazygit

Open dwt opened this issue 9 months ago • 3 comments

When working with lazygit I have it configured to use delta like this:

~/Library/Application Support/lazygit
❯ cat config.yml -p
git:
  paging:
    colorArg: always
    pager: delta --paging=never --detect-dark-light always
    # pager: delta --paging=never --dark
    # pager: delta --paging=never --light
    # useConfig: true

This however always uses the dark theme

Image

Even when the light mode is on

Image

I currently work around this by constantly switching the pager declaration in the config file, but I would much rather delta could auto switch based on the output of defaults read -g AppleInterfaceStyle.

Is there a way to do so? If not, I would be glad to provide a shell script to ask for the mode as a config parameter.

dwt avatar Mar 04 '25 19:03 dwt

Forgot to say, this is on

❯ delta --version
delta 0.18.2

dwt avatar Mar 04 '25 19:03 dwt

there is #447, which might be related, but there seems to have been a consensus there that this can be detected. I think that there should be an escape hatch to provide this information by a specialized tool that the user can control.

dwt avatar Mar 04 '25 19:03 dwt

To consider - implement automatic theme detection from terminal with CSI 996/2031, which should be more robust https://github.com/contour-terminal/contour/blob/master/docs/vt-extensions/color-palette-update-notifications.md

Dom324 avatar Mar 11 '25 21:03 Dom324