jesseduffield / lazygit

simple terminal UI for git commands

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

lazygit does not run on fedora 36

bennypowers opened this issue · comments

Describe the bug
lazygit quits with stat ~/.config/lazygit/config.yml: no such file or directory. This is a 2-day old fedora 36 installation.

$ cat ~/.config/lazygit/config.yml
os:
  editCommand: floaterm

gui:
  theme:
    selectedLineBgColor:
      - underline
    selectedRangeBgColor:
      - underline

git:
  paging:
    colorArg: never
    pager: delta --dark --paging=never

quitOnTopLevelReturn: true
$ lazygit
2022/06/13 17:51:27 stat ~/.config/lazygit/config.yml: no such file or directory

To Reproduce
Steps to reproduce the behavior:

  1. copy above to ~/.config/lazygit/config.yml
  2. install lazygit per instructions
  3. run lazygit

Expected behavior
lazygit launches with given config

Desktop (please complete the following information):

  • OS: Fedora 36
  • Lazygit Version commit=, build date=, build source=unknown, version=0.34, os=linux, arch=amd64

Does it work without the config?

$ rm .config/lazygit/config.yml
$ lazygit
2022/06/13 19:46:23 stat ~/.config/lazygit/config.yml: no such file or directory
$ vim ~/.config/lazygit/config.yml
$ lazygit
2022/06/13 19:48:11 stat ~/.config/lazygit/config.yml: no such file or directory

I cannot reproduce it in the fedora:latest docker image, neither v0.34 nor master.

Could you try building master to see if it helps?

~/Developer $ git clone https://github.com/jesseduffield/lazygit.git
              cd lazygit
              go install
Cloning into 'lazygit'...
remote: Enumerating objects: 42509, done.
remote: Counting objects: 100% (445/445), done.
remote: Compressing objects: 100% (209/209), done.
remote: Total 42509 (delta 246), reused 411 (delta 217), pack-reused 42064
Receiving objects: 100% (42509/42509), 36.85 MiB | 1.77 MiB/s, done.
Resolving deltas: 100% (26425/26425), done.
~/D/lazygit $ lazygit 
2022/06/13 23:29:55 stat ~/.config/lazygit/config.yml: no such file or directory
~/D/lazygit $ which lazygit 
/usr/bin/lazygit

😕

I think the default path for go install is $HOME/go/bin, could you try running go build && ./lazygit ?

I've also Fedora 36 (upgraded from Fedora 35) and lazygit 0.34 works for me. Even if I remove the config files or the whole config directory, it still works.

Maybe permission to the directory/files?

$ cat /etc/yum.repos.d/_copr:copr.fedorainfracloud.org:atim:lazygit.repo 
[copr:copr.fedorainfracloud.org:atim:lazygit]
name=Copr repo for lazygit owned by atim
baseurl=https://download.copr.fedorainfracloud.org/results/atim/lazygit/fedora-$releasever-$basearch/
type=rpm-md
skip_if_unavailable=True
gpgcheck=1
gpgkey=https://download.copr.fedorainfracloud.org/results/atim/lazygit/pubkey.gpg
repo_gpgcheck=0
enabled=1
enabled_metadata=1
$ cat ~/.config/lazygit/config.yml
$ ll
total 4,0K
-rw-r--r-- 1 mira mira   0 11. Aug 2021  config.yml
-rw-r--r-- 1 mira mira 175 14. Jun 12:04 state.yml

for reference:

$ cat /etc/yum.repos.d/_copr:copr.fedorainfracloud.org:atim:lazygit.repo
[copr:copr.fedorainfracloud.org:atim:lazygit]
name=Copr repo for lazygit owned by atim
baseurl=https://download.copr.fedorainfracloud.org/results/atim/lazygit/fedora-$releasever-$basearch/
type=rpm-md
skip_if_unavailable=True
gpgcheck=1
gpgkey=https://download.copr.fedorainfracloud.org/results/atim/lazygit/pubkey.gpg
repo_gpgcheck=0
enabled=1
enabled_metadata=1
$ cat ~/.config/lazygit/config.yml
os:
  editCommand: floaterm

gui:
  theme:
    selectedLineBgColor:
      - underline
    selectedRangeBgColor:
      - underline

git:
  paging:
    colorArg: never
    pager: delta --dark --paging=never

quitOnTopLevelReturn: true
$ ll ~/.config/lazygit/
total 4.0K
-rw-r--r--. 1 bennyp bennyp 233 Jun 13 19:48 config.yml
$ lazygit
2022/06/19 07:54:40 stat ~/.config/lazygit/config.yml: no such file or directory
$ ll (which lazygit)
-rwxr-xr-x. 1 root root 14M Mar 17 09:29 /usr/bin/lazygit*

could you try running go build && ./lazygit ?

Have you tried this in the meantime?

Big oof 🙈

$ go build && ./lazygit
2022/06/21 18:29:30 stat ~/.config/lazygit/config.yml: no such file or directory

I also tried this just in case, but it made no difference:

$ sudo mkdir -p /root/.config/lazygit/
$ sudo cp ~/.config/lazygit/config.yml /root/.config/lazygit/config.yml

I am on Fedora 36 Silverblue and everything works fine with the binary from the Github releases page. Can you please try to uninstall lazygit from copr and put the binary from the releases page in ~/bin?

$ sudo dnf remove lazygit
...
$ cp Downloads/lazygit_0.34_Linux_x86_64/lazygit bin/
$ lazygit
2022/06/24 08:59:58 stat ~/.config/lazygit/config.yml: no such file or directory

I can kind of reproduce your error this way:

$ LG_CONFIG_FILE="~/.config/lazygit/config.yml" lazygit
2022/06/24 15:26:55 stat ~/.config/lazygit/config.yml: no such file or directory

It seems like lazygit does not expand "~" to home.

Do you set this varialbe anywhere?

@bennypowers Please post the output of the following commands:

echo $CONFIG_DIR
echo $LG_CONFIG_FILE
CONFIG_DIR="$HOME/.config/lazygit" lazygit
LG_CONFIG_FILE="$HOME/.config/lazygit/config.yml" lazygit

For reference:
I did try to debug by reading this file: https://github.com/jesseduffield/lazygit/blob/master/pkg/config/app_config.go
That is how I found about the environment variables.
Here is the related documentation: https://github.com/jesseduffield/lazygit/blob/master/docs/Config.md#overriding-default-config-file-location

🔔 🔔 🔔 🔔 🔔

We have a winner!

I had this in my fish shell config:

set -gx LG_CONFIG_FILE "~/.config/lazygit/config.yml"

Removing the double-quotes solved it.

Thanks

Happy to know that it worked ^^

The problem with not expanding ~ should be addressed. I made a PR: #2015

commented

🔔 🔔 🔔 🔔 🔔

We have a winner!

I had this in my fish shell config:

set -gx LG_CONFIG_FILE "~/.config/lazygit/config.yml"

Removing the double-quotes solved it.

Thanks

I ran into this issue on my M1 Mac as well and this did the trick! Many thanks!

ezoic increase your site revenue