Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Git pager delta background true color not working #3362

Closed
jdujava opened this issue Mar 5, 2024 · 8 comments
Closed

Git pager delta background true color not working #3362

jdujava opened this issue Mar 5, 2024 · 8 comments
Labels
bug Something isn't working

Comments

@jdujava
Copy link

jdujava commented Mar 5, 2024

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"
@jdujava jdujava added the bug Something isn't working label Mar 5, 2024
@jdujava
Copy link
Author

jdujava commented Mar 10, 2024

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

@jdujava
Copy link
Author

jdujava commented Mar 14, 2024

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.

@jdujava jdujava closed this as completed Mar 14, 2024
@georgeguimaraes
Copy link

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

@Susensio
Copy link

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

@jdujava
Copy link
Author

jdujava commented Jun 17, 2024

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.

@Susensio
Copy link

Susensio commented Jun 17, 2024

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

@georgeguimaraes
Copy link

no, I'm not using tmux, but I'm using Wezterm and my TERM is 'wezterm'.

But yeah, using
TERM=screen-256color lazygit solves all my issues with the colors in the pager/diff.

Tks a lot! (and sorry for the late reply)

@joshgoebel
Copy link

For anyone running Ghostty and running into this: #4149

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants