lazygit icon indicating copy to clipboard operation
lazygit copied to clipboard

lazygit not using delta"s colors

Open xeros-and-ones opened this issue 2 years ago • 3 comments

Lazygit suddenly not respecting or using delta's colours

this is how delta looks like in the terminal as a pager: Screenshot_20231028_092740

And this is how delta looks in lazygit: Screenshot_20231028_092838

commit=v0.40.2, build source=binaryRelease, version=0.40.2, os=linux, arch=amd64, git version=2.42.0

Here's My config: lazygit ▼▼▼▼

# yaml-language-server: $schema=https://json.schemastore.org/lazygit.json
gui:
  expandFocusedSidePanel: true
  nerdFontsVersion: '3'
  border: 'rounded'
  theme:
    selectedLineBgColor:
      - black
      - bold
    selectedRangeBgColor:
      - green
      - bold
git:
  paging:
    colorArg: always
    pager: delta --dark --paging=never

git ▼▼▼▼

[core]
    editor = nvim
    pager = delta
[interactive]
    diffFilter = delta --color-only
[delta]
    navigate = true    # use n and N to move between diff sections
    light = false      # set to true if you're in a terminal w/ a light background color (e.g. the default macOS terminal)
    side-by-side = false
    line-numbers = true
    syntax-theme = gruvbox-dark
[merge]
    conflictstyle = diff3
[diff]
    colorMoved = default

xeros-and-ones avatar Oct 28 '23 07:10 xeros-and-ones

Did you ever resolve this?

HoffsMH avatar May 19 '24 01:05 HoffsMH

Also seeing this issue, using the Visual Studio Dark+ theme.

xyven1 avatar May 30 '24 15:05 xyven1

I have this issue as well.

Delta config:

git:
  log:
    showGraph: always
    showWholeGraph: false
  paging:
    pager: delta --dark --paging=never
gui:
  nerdFontsVersion: '3'
  showFileTree: false

Version:

❯ lazygit --version
commit=, build date=, build source=nix, version=0.43.1, os=darwin, arch=arm64, git version=2.45.2
❯ delta --version
delta 0.18.0

V4G4X avatar Sep 26 '24 17:09 V4G4X

I am experiencing the same issues when using delta with lazygit. Delta seems to work fine on CLI, colors seems to mismatch when using it with lazygit

avimehenwal avatar Nov 02 '24 18:11 avimehenwal

Same here with:

❯ lazygit --version
commit=, build date=, build source=homebrew, version=0.44.1, os=darwin, arch=arm64, git version=2.47.0
❯ delta --version
delta 0.18.2

diego898 avatar Nov 06 '24 16:11 diego898

it seems I'm not the only one having this issue.i removed delta as lazygit's pager and it works fine when i need it. I'm now using magit which funny enough it has the same issue with delta. but it has a good diff so I'm using that

xeros-and-ones avatar Nov 06 '24 21:11 xeros-and-ones

Same here, with the same versions of lazygit and delta as @diego898. Using gnome terminal with Tango theme if that makes any difference.

anvandaren avatar Nov 12 '24 13:11 anvandaren

Turns out the culprit for me was byobu. Discovered that the colors were correct outside byobu.

Followed this instruction from Delta and now it works: https://dandavison.github.io/delta/tips-and-tricks/using-delta-with-tmux.html

anvandaren avatar Nov 12 '24 14:11 anvandaren

@anvandaren You're right I noticed this as well.

The colours are incorrect only inside tmux.

Just that adding set -ga terminal-overrides ",*-256color:Tc" in my .tmux.conf didn't help.

Running the colour test script returns this (I'm not sure if it's supposed to be correct) image

Edit: New observation actually.

  1. Outside Tmux: Lazygit colours are correct.
  2. Inside Tmux: Lazygit colours are wrong.
  3. Opening lazygit inside neovim inside tmux? Colours are correct!

Hope this can shed some light.

V4G4X avatar Nov 16 '24 07:11 V4G4X

I can confirm what @V4G4X said, it is exactly what is happening here.

erlonbie avatar Jan 06 '25 14:01 erlonbie

I'm seeing exact same thing as @V4G4X references as 1 through 3.

chris4prez avatar Jan 10 '25 23:01 chris4prez

Can you test this again with current master? I don't understand the problem well enough to tell for sure, but I have the suspicion that it might be fixed by #4166 which was merged today.

stefanhaller avatar Jan 12 '25 12:01 stefanhaller

Can you test this again with current master? I don't understand the problem well enough to tell for sure, but I have the suspicion that it might be fixed by #4166 which was merged today.

This fixed the issue for me, without changing anything else.

Jaco-Minnaar avatar Jan 14 '25 09:01 Jaco-Minnaar