Skip to content

Incomplete selected line highlight in diff pane #6117

Open

Description

@PedroANeves

Describe the bug

Selecting a line/hunk in the diff pane does not highlight the entire line, only highlights the first two and last two characters. (0.65.x works fine.)

To Reproduce

Steps to reproduce the behavior:

  1. Open lazygit (v0.66.x) in a repository with changes.
  2. Navigate to the diff pane.
  3. Select a line/hunk in the changes view.
  4. Observe the broken/incomplete line highlighting.

Expected behavior

The selected line should be highlighted fully across the width of the diff pane.

Screenshots

Image Image Image

Version info:

commit=b741725a2413fc9cbc01529cab0e7cc654ad2054, build date=2026-10-11T09:23:32Z, build source=binaryRelease, version=0.66.1, os=linux, arch=amd64, git version=2.47.3

Terminal info:

Tested both on:

  • GNOME Terminal 3.52.0
  • rxvt-unicode (urxvt) v9.31

Additional context

Tested on linux mint 22.3 and debian trixie.
No custom config.yml.
Same issue on building from latest with go install github.com/jesseduffield/lazygit@latest.

Activity

  1. stefanhaller commented on Oct 12, 2026

    @stefanhaller
    Collaborator

    This is intentional, and has been discussed here a few times. See for example #6098.

  2. davepgreene commented on Oct 13, 2026

    @davepgreene

    Is there any way to set it back to the previous behavior or at least imitate it with git delta? I have some vision problems and the previous behavior's complete line highlighting made it much easier to track hunks while the new method makes it so much harder.

  3. stefanhaller commented on Oct 16, 2026

    @stefanhaller
    Collaborator

    I have some vision problems and the previous behavior's complete line highlighting made it much easier to track hunks while the new method makes it so much harder.

    I'm sorry to hear that. Can you try if you can improve it by tweaking the selection color? Try something like

    gui:
      theme:
        selectedLineBgColor:
          - "#3377cc"

    I'm not sure what you mean by "imitate it with git delta". If you use delta, rather than the raw git diff, then selecting the entire line is simply not an option, as the screen shot in #6098 (comment) shows. And when people tell me "but I don't use delta, so for me it would be fine to select the whole line", I can only say you are missing out. Try delta, it really improves the lazygit experience considerably; that's why I insist on this so much.

  4. davepgreene commented on Oct 16, 2026

    @davepgreene

    I have some vision problems and the previous behavior's complete line highlighting made it much easier to track hunks while the new method makes it so much harder.

    I'm sorry to hear that. Can you try if you can improve it by tweaking the selection color? Try something like

    gui:
      theme:
        selectedLineBgColor:
          - "#3377cc"
    

    I'm not sure what you mean by "imitate it with git delta". If you use delta, rather than the raw git diff, then selecting the entire line is simply not an option, as the screen shot in #6098 (comment) shows. And when people tell me "but I don't use delta, so for me it would be fine to select the whole line", I can only say you are missing out. Try delta, it really improves the lazygit experience considerably; that's why I insist on this so much.

    I've already got a more visible color selected using gui.theme.selectedLineByColorand am already using delta; in fact I've been using delta since before this change.

    The problem is two-fold. First (and this is probably more of a bug), the sidebar highlight overlaps line numbers when setting line-numbers = true in delta's config. This makes the sidebar highlight visually confusing even without considering whole line highlighting because it conflicts with delta's line-number color settings. The number of colored spaces is hardcoded 2 and can't be changed.

    Second is that the replacement is fundamentally not the same as the previous full line highlight. If I could use an analogy, the current behavior is like using a finger to point to a line you're reading in a book vs highlighting the line. The behaviors aren't the same and serve different purposes in terms of visually orienting the user to the change.

    I understand that the new setting works for you and that's awesome so I'm not expecting you'll change this back but it is worth knowing that this change is more of an accessibility issue and should probably be treated as one by allowing the user to set the behavior rather than have it be a take-it-or-leave-it situation.

  5. stefanhaller commented on Oct 16, 2026

    @stefanhaller
    Collaborator

    First (and this is probably more of a bug), the sidebar highlight overlaps line numbers when setting line-numbers = true in delta's config.

    I thought about that; it would be nicer if the highlight would be to the right of the line numbers, where the diff actually starts. Trouble is, this would require an extension to the OSC 1717 protocol so that the diff renderer can tell lazygit where it should put the highlight; that's a lot of work, and I'm not sure it's worth it. But it would allow showing the highlight at the left edge of the second column in --side-by-side mode too.

    One question about line numbers: are you using them only so that you can use hyperlinks to jump to the editor? Just in case you missed that you can also do that now by alt-clicking anywhere on the line. Of course, if you like seeing line numbers for other reasons, then the problem is still there.

    but it is worth knowing that this change is more of an accessibility issue

    Yes, I understand this. The problem is that I don't know a good solution; going back to highlighting the whole line simply doesn't work, since the selection changes the background color. For delta, we'd probably have to change the foreground color instead, or something like that; but I'm not sure this would look good. If you have a good suggestion here, I'm all ears; I'm not super happy with the narrow selection bar either, I just haven't found anything better.

  6. Operdies commented on Oct 16, 2026

    @Operdies

    I am having similar issues. I also find the highlight too subtle (and sorry to say, the highlight on both sides of the diff quite ugly).

    I am now trying out delta thanks to the discussion in this issue, which I am thankful for. It is quite nice! However, it doesn't address the usability issues. I am experimenting with my theme to make it more readable, but it is difficult to find a background highlight which looks good in both the diff viewer and the other windows. Perhaps they should be separately configurable?

    It doesn't look like delta is using text attributes such as bold, underline, italics, etc. I wonder if that is an option?

  7. simon-abbott commented on Oct 29, 2026

    @simon-abbott

    I personally don't use delta or any other other diff renderer–I actually prefer the default git diff view, it just makes more sense to my brain–and with the default git diff the two character highlight is hard to use. While I am all for increasing compatibility with other tools, I think it is important to recognize that while lazygit and delta work well together, at the end of the day lazygit is a git client, and should work well out-of-the-box with the default tools git gives, not require yet another tool for optimal performance. Having only 4 characters of highlight makes it hard for me to tell which line are actually being selected, especially in wide windows, which I usually use.

    I am strongly in favor of bringing back the full-width highlight, either universally or per-tool. Since I only have the one tool, the default git diff, those are the same to me.

    Some ways to do this I have thought of:

    1. Have a single global setting -- doesn't play nice with different renderer styles, as noted above
    2. Have per-tool overrides -- unnecessary complicated to configure for those of us who just use the default git diff
    3. Combine 1 + 2: global default + per-tool overrides -- my preference; allows for easy configuration, while still letting power users have different settings for each tool
    4. Combine 1 + 2, and set sensible defaults -- taking option 3 a step further, you can set sensible per-tool defaults (e.g. git diff uses full-width, delta uses two characters, etc.), while still letting users override that setting as they desire. Ideally the global default will still override these defaults, so users can trivially set a uniform behavior should they desire that.

    I think option 4 will provide the best out-of-the-box experience, but will also understandably be the most work, but I personally will be happy with any of the 4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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