lazygit icon indicating copy to clipboard operation
lazygit copied to clipboard

WARNING terminal is not fully functional, but sometimes it is?

Open zamlz opened this issue 1 year ago • 18 comments

Describe the bug Here is a picture of the issue.

image

As you can see, the subwindow is showing the error message

WARNING: terminal is not fully functional

However, if I press ENTER on the file in my FILES view, I am able to view and interact with my changes as expected.

image

To Reproduce

  1. Open up LazyGit
  2. Press enter on a file to change the view of the second window
  3. See that it is working
  4. Press escape and leave that view to see it being broken again.

Expected behavior It shows the correct window

Version info:

commit=, build date=, build source=nix, version=0.42.0, os=linux, arch=amd64, git version=2.45.1
git version 2.45.1

zamlz avatar Jun 30 '24 04:06 zamlz

I have the same issue. I'm using lazygit in my neovim inside the tmux (zsh, macOS Sonoma 14.5). Was trying to handle this by changing my .zshrc: if [ -n "$TMUX" ]; then export TERM="tmux-256color" else export TERM="xterm-256color" fi

and my .tmux.conf: set -g default-terminal "tmux-256color" set-option -ga terminal-overrides ",xterm-256color:Tc"

and explicitly set there the colors (as a GPT-proposal), but end up with no results.

olexii-lysenko avatar Jul 05 '24 09:07 olexii-lysenko

Having the same issue :( Any progress ? image image

iamrx0 avatar Jul 05 '24 10:07 iamrx0

No progress on my end. The terminal I'm using is alacritty

> echo $TERM
alacritty

I tried temporarily overriding the TERM variable with the following terminal names and that didn't change behaviour either. Used, xterm, xterm-256color and tmux-256color 😭

zamlz avatar Jul 05 '24 16:07 zamlz

any updates?

Woit avatar Jul 12 '24 09:07 Woit

I haven't had a chance to test anything more on my end unfortunately :(

On Friday, July 12th, 2024 at 2:15 AM, Egor M @.***> wrote:

any updates?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

zamlz avatar Jul 15 '24 00:07 zamlz

Same with 0.43.1 here

Djedouas avatar Jul 22 '24 09:07 Djedouas

Run into this on xterm-kitty.

Gabriel-Rockson avatar Jul 22 '24 09:07 Gabriel-Rockson

@zamlz In my case, it was due to lazygit configuration located at Library/Application\ Support/lazygit/config.yml(location differ on other OS).

gui:
  showIcons: true # DEPRECATED
git:
  paging:
    useConfig: true

I just delete all configuration, and problem is solved.

minseon9 avatar Aug 04 '24 15:08 minseon9

In my case, I delete "useConfig" option located at Library/Application\ Support/lazygit/config.yml(location differ on other OS).

before:

gui:
 showIcons: true # DEPRECATED
git:
 paging:
   pager: delta --dark --paging=never
   useConfig: true

after:

gui:
 showIcons: true # DEPRECATED
git:
 paging:
   pager: delta --dark --paging=never

I just delete useConfig:true, and it worked.

Lonzoghf avatar Aug 05 '24 09:08 Lonzoghf

For me it was the pager: "less" config option I had that was creating the error.

Leaving pager empty with pager: "" fixes the problem.

Djedouas avatar Aug 05 '24 12:08 Djedouas

In my case, I delete "useConfig" option located at Library/Application\ Support/lazygit/config.yml(location differ on other OS).

before:

gui:
 showIcons: true # DEPRECATED
git:
 paging:
   pager: delta --dark --paging=never
   useConfig: true

after:

gui:
 showIcons: true # DEPRECATED
git:
 paging:
   pager: delta --dark --paging=never

I just delete useConfig:true, and it worked.

Same for me.

iamrx0 avatar Aug 05 '24 15:08 iamrx0

Oh wow, y'all are right. I had the useConfig: true set on mine and I removed it and everything is working again. I wonder why I set that in the first place though?

zamlz avatar Aug 05 '24 18:08 zamlz

Okay I must have removed whatever pager I had set in .gitconfig The documentation here actually is key. https://github.com/jesseduffield/lazygit/blob/master/docs/Custom_Pagers.md#using-git-config

I did not realize it would still try to use less even if nothing was set on the .gitconfig side.

zamlz avatar Aug 05 '24 18:08 zamlz

in my case

before:

gui:
  showIcons: true

git:
  paging:
    colorArg: always
    pager: delta --dark --paging=always --commit-style box

after:

gui:
  showIcons: true

git:
  paging:
    colorArg: always
    pager: delta --dark --paging=never --commit-style box

Woit avatar Aug 06 '24 14:08 Woit

I ran into this today and went looking, and I think I've found the cause: the current logic for useConfig: true seems to be as follows:

  1. Try to get the value of $GIT_PAGER, if empty try $PAGER, if empty try the value of core.pager set in git config
  2. For the value resolved in 1, take everything to the left of '| less' if present, else all of it
  3. Use the value resolved in 3 as the pager

Now, for most folks $PAGER is likely to be set to less (try it: run echo $PAGER in your terminal). This thus leads to an attempt to use less as the pager, which is known to not work well with lazygit:

... because less doesn't play nice with our rendering approach.

@jesseduffield What was the reason for using $PAGER? I tried looking at the relevant PR but couldn't find any comment about it. In my understanding this is variable is not related to git directly and is quite likely to be set to less. If there is no specific reason, can we skip looking at the value of $PAGER and instead directly go from $GIT_PAGER to git config?

(Hey @zamlz, would you mind re-opening this issue, so that the discussion here can continue until this is resolved in some way?)

aksh1618 avatar Sep 04 '24 19:09 aksh1618

@aksh1618 This all makes sense; I wasn't around yet when the pager PR was done, so I can only guess, but I speculate that the only reason for including $PAGER is that git does that too. Like with $GIT_EDITOR and $EDITOR.

Your proposed fix of skipping $PAGER makes sense to me.

However, I will also say that I don't see a lot of value in the useConfig: true setting in the first place, where we need to tweak the config into one that works for us (by stripping | less, but what if they use a different pager like Moar, or pass options to less, or don't have a space between | and less, etc. etc.?).

I wouldn't mind if we got rid of the useConfig option, and let users specify exactly what they want to use in lazygit. This would get rid of this whole class of problems.

I can't decide this though, so I hope @jesseduffield sees this (he's pretty busy these days). Reopening for now.

stefanhaller avatar Sep 05 '24 07:09 stefanhaller

Sorry, I thought the issue was resolved because the documentation I linked clearly explained the issue. I guess the follow-up is that is how the pager is resolved and if this logic should be updated at all. Thanks @stefanhaller for opening it again.

zamlz avatar Sep 05 '24 15:09 zamlz

Thanks for the detailed reply @stefanhaller!

For me the value proposition of useConfig is that lazygit automatically updates whenever I modify the pager used in git, which is admittedly not a mjor one as it's a pretty rare thing to do.

However, I agree with you that this could potentially turn into a never ending rabbit hole of edge cases as we're entering command parsing territory here! So removing the useConfig option seems like the way to go to me as well, in its current form at least.

(No worries @zamlz, you reserve the right to close as the author as you deem fit!)

aksh1618 avatar Sep 06 '24 06:09 aksh1618

In my case, I delete "useConfig" option located at Library/Application\ Support/lazygit/config.yml(location differ on other OS).

before:

gui:
 showIcons: true # DEPRECATED
git:
 paging:
   pager: delta --dark --paging=never
   useConfig: true

after:

gui:
 showIcons: true # DEPRECATED
git:
 paging:
   pager: delta --dark --paging=never

I just delete useConfig:true, and it worked.

That's it!! Thanks a lot

onexbash avatar Nov 19 '24 18:11 onexbash

Same problem without custom config:

Lazygit version:

commit=91cb1ff29a01fdf643ccc38b97fd816b2a097bec, build date=2025-01-11T04:06:07Z, build source=binaryRelease, version=0.45.0, os=darwin, arch=arm64, git version=2.39.5 (Apple Git-154)

image

image

pookdeveloper avatar Jan 14 '25 06:01 pookdeveloper

If you got here trying to get the built-in diff-highlight to work, just ensure its dir is in your $PATH and then do:

git:
  paging:
    colorArg: always
    pager: diff-highlight

For some reason useConfig: true breaks in some cases as mentioned above.

minusfive avatar Mar 13 '25 20:03 minusfive

This issue also happens to me. Removing the useConfig: true helped.

hanpham32 avatar Jul 13 '25 02:07 hanpham32

Removing pager.useConfig: true worked for me too.

I want to point out the docs currently claim useConfig has no effect when using externalDiffCommand, which is not the case!

The colorArg, pager, and useConfig options are not used [when using external diff commands].

See https://github.com/jesseduffield/lazygit/blob/v0.54.1/docs/Custom_Pagers.md?plain=1#L80

I think fixing the code to match the docs would already make this less of an issue since useConfig would not interfere for externalDiffCommand users.

ThinkChaos avatar Aug 10 '25 14:08 ThinkChaos

I want to point out the docs currently claim useConfig has no effect when using externalDiffCommand, which is not the case!

@ThinkChaos This is fixed by #4837, which removes the useConfig option.

stefanhaller avatar Aug 20 '25 08:08 stefanhaller