jesseduffield / lazygit

simple terminal UI for git commands

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Git pager `delta` background true color not working

jdujava opened this issue · comments

Describe the bug
Changing delta background colors is not properly reflected in lazygit (I think the true color support is broken, since colors adapt only for bigger steps, and are not "true", but only rough approximations). It is not caused by delta, since directly running git diff ... always shows proper true colors (in less pager).

It worked well for version
commit=af56065dd, build date=20240302.090028, build source=unknown, version=pre-0.41.af56065dd, os=linux, arch=amd64, git version=2.44.0,
and I noticed that it is broken for
commit=0f1406524, build date=20240302.093914, build source=unknown, version=pre-0.41.0f1406524, os=linux, arch=amd64, git version=2.44.0.

To Reproduce

# ~/.config/lazygit/config.yml
git:
  paging:
    colorArg: always
    pager: delta --paging=never
# ~/.config/git/config
[delta]
    true-color = always
    syntax-theme = Visual Studio Dark+
    plus-style = syntax "#243228"

Interestingly, when running lazygit from neovim, both versions display correct colors. Any idea what could cause such behavior?

Using environment variable COLORTERM=truecolor fixed the issue (I am using st terminal). Anyway, something must have changed, since it worked for me by default in previous versions.

I have the same behaviour.

I'm using Wezterm 20240203-110809-5046fc22,
lazygit commit=, build date=, build source=homebrew, version=0.41.0, os=darwin, arch=arm64, git version=2.44.0

❯ env | grep COLORTERM
COLORTERM=truecolor 

In lazygit (strange background color):
SCR-20240325-prml

Using git diff (correct background color):
SCR-20240325-przv

Using lazygit inside Neovim (correct background color):
SCR-20240325-psbv

My config:

[delta "decorations"]
  minus-style                   = syntax "#3f2d3d"
  minus-non-emph-style          = syntax "#3f2d3d"
  minus-emph-style              = syntax "#763842"
  minus-empty-line-marker-style = syntax "#3f2d3d"
  line-numbers-minus-style      = "#b2555b"
  plus-style                    = syntax "#283b4d"
  plus-non-emph-style           = syntax "#283b4d"
  plus-emph-style               = syntax "#316172"
  plus-empty-line-marker-style  = syntax "#283b4d"
  line-numbers-plus-style       = "#399a96"
  line-numbers-zero-style       = "#3b4261"
  line-numbers-left-format      = "{nm:^4}"

  commit-decoration-style = blue ol
  commit-style = raw
  file-style = omit
  hunk-header-decoration-style = blue box
  hunk-header-file-style = "#c0caf5"
  hunk-header-line-number-style = "#e0af68"
  hunk-header-style = file line-number syntax

Same problem here. @jdujava how did you solve it?

Using environment variable COLORTERM=truecolor fixed the issue (I am using st terminal). Anyway, something must have changed, since it worked for me by default in previous versions.

@Susensio Like I said before, setting COLORTERM environment variable was enough for me.

Strange...
@georgeguimaraes are you by any change using tmux? I'm getting this problem only inside tmux

edit:
TERM=tmux-256color fails,
TERM=screen-256color seems to work