Skip to content

Wrong delta diff background color in Ghostty #4133

@ComplexPlane

Description

@ComplexPlane

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions