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

Wrong delta diff background color in Ghostty #4133

Open
ComplexPlane opened this issue Dec 31, 2024 · 2 comments
Open

Wrong delta diff background color in Ghostty #4133

ComplexPlane opened this issue Dec 31, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@ComplexPlane
Copy link

Describe the bug

When using the delta pager in lazygit specifically in Ghostty, the background color for line-wise additions is gray instead of green.

Here's a summary of the background color values I observe in different situations (using the terminal inspector in Ghostty), including running delta outside lazygit, overriding TERM, and in kitty:

Terminal Command Background Color Correct
ghostty lg Palette 235 (#262626) No
ghostty TERM=xterm-kitty lg #002800 Yes
ghostty delta #002800 Yes
ghostty delta --true-color never Palette 22 (#005f00) Yes
kitty lg #002800 (color picker) Yes

Is this related? #2962

To Reproduce

Install Ghostty and delta, and use this lazygit config:

git:
  paging:
    colorArg: always
    pager: delta --dark --paging=never --line-numbers --hyperlinks --hyperlinks-file-link-format="lazygit-edit://{path}:{line}"

Screenshots

It should look like:

image

Actual:

image

Version info:
commit=611fabde11d24d9acc71ee26077b9a1101f59f27, build date=2024-09-18T10:56:10Z, build source=binaryRelease, version=0.44.1, os=darwin, arch=arm64, git version=2.39.5 (Apple Git-154)

git version 2.39.5 (Apple Git-154)

This issue is also present on master.

@ComplexPlane ComplexPlane added the bug Something isn't working label Dec 31, 2024
@yudai0804
Copy link

I am struggling with the same issue.
There was no issue when using delta on its own. However, it doesn't work properly when using delta with lazygit.

@tdimeco
Copy link

tdimeco commented Jan 1, 2025

Same issue here. Running TERM=xterm-256color lg seems to fix the issue.

Is this related to this post? https://mitchellh.com/writing/ghostty-devlog-004
Especially the following part:

We found other upstream bugs, and I'm proud that Ghostty community have been not only reporting issues, but also providing fixes. Tim made a PR to the popular Go library tcell to fix a particularly bad issue. This is an important library since it is used by popular TUI applications such as lazygit, lazydocker, etc. Without this fix, all of those programs spew garbage unless you run them explicitly with TERM=xterm-256color. I hope this can be accepted soon!

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

3 participants