Lazygit: Custom pagers not working for diff. (delta or diff-so-fancy)

Created on 20 Jul 2020  ยท  5Comments  ยท  Source: jesseduffield/lazygit

Describe the bug
I followed the instruction to add custom pager to my config and they are not working. I've tried both delta and diff-so-fancy; they work outside lazygit but not in it.

I also noticed in the created config.yml file it says colorargs and not colorArgs that could be a typo somewhere in the code, but that's not the real issue as I set both of them.

I've tried both like so and neither render in the diff window. This is what the config looks like:

git:
  autofetch: true
  merging:
    args: ""
    manualcommit: false
  paging:
    colorarg: always
    #useconfig: false
    colorArg: always
    pager: diff-so-fancy
    #pager: delta --dark --paging=never --24-bit-color=never

To Reproduce

  1. Add custom pagers to your config.

Expected behavior
It should use the custom pagers.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: macos
  • Lazygit Version: commit=, build date=, build source=homebrew, version=0.20.4, os=darwin, arch=amd64
bug

Most helpful comment

@Cokile your issue is a result of lazygit not supporting 24 bit colors (this is because termbox, one of its dependencies, does not support 24 bit colors). Unfortunately there is no way around this currently, unless you use delta which supports non-24 bit color terminals via the --24-bit-color=never flag.

Having said all that, I believe @lordlycastle 's issue is that the pager does not work at all in lazygit.

All 5 comments

Same here for diff-so-fancy.

BTW, it seems that config is case-insensitive.

Works for me:
image

I'm not sure if I mention it in the docs but you will need to have the relevant pager installed (though you do mention they work outside of lazygit @lordlycastle).

Would you be able to provide your env values for COLORTERM, TERM, PAGER, and LESS. Here's mine:

COLORTERM=truecolor
TERM=xterm-256color
PAGER=less
LESS=-R

Outside of lazygit:
Screen Shot 2020-08-12 at 17 18 27

Inside of lazygit:
Screen Shot 2020-08-12 at 17 18 39

As you can see, the n is highlighted from the first picture but not in the second one.

Here is my whole config file:

git:
  paging:
    colorarg: always
    pager: diff-so-fancy

reporting: "off"
startuppopupversion: 1

Here is my env values:

COLORTERM=truecolor
TERM=xterm-256color
PAGER=less
LESS=-R

@Cokile your issue is a result of lazygit not supporting 24 bit colors (this is because termbox, one of its dependencies, does not support 24 bit colors). Unfortunately there is no way around this currently, unless you use delta which supports non-24 bit color terminals via the --24-bit-color=never flag.

Having said all that, I believe @lordlycastle 's issue is that the pager does not work at all in lazygit.

I'm seeing something similar. It works when I use delta in the command line and I reference it in the lazygit config but not when I set lazygit to use the git pager which is set to use delta.

.gitconfig (https://github.com/briandipalma/machine-setup/blob/master/.gitconfig#L36):

  36   โ”‚ [diff]
  37   โ”‚   colorMoved = default
  38   โ”‚
  39   โ”‚ [core]
  40   โ”‚   pager = delta
  41   โ”‚
  42   โ”‚ [interactive]
  43   โ”‚   diffFilter = delta --color-only
  44   โ”‚
  45   โ”‚ [delta]
  46   โ”‚   side-by-side = true
  47   โ”‚   syntax-theme = Solarized (light)

Failing lazygit config:

git:
  paging:
    colorArg: always
    useConfig: true

Successful lazygit config (https://github.com/briandipalma/machine-setup/blob/master/lazygit-config.yml#L10):

git:
  paging:
    colorArg: always
    pager: delta --paging=never --24-bit-color=never

I get some odd characters in the Unstaged Changes output when its set to use the git pager: [?1049h[?1h=

image

Was this page helpful?
0 / 5 - 0 ratings

Related issues

JoeKlemmer picture JoeKlemmer  ยท  3Comments

cbeley picture cbeley  ยท  6Comments

glvr182 picture glvr182  ยท  6Comments

rubensr-pc picture rubensr-pc  ยท  5Comments

itsheng picture itsheng  ยท  7Comments