lazygit: lazygit does not run on fedora 36

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

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 15

Most upvoted comments

🔔 🔔 🔔 🔔 🔔

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: https://github.com/jesseduffield/lazygit/pull/2015

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

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