lazygit icon indicating copy to clipboard operation
lazygit copied to clipboard

LazyGit Seemingly Not Reading in Config

Open andscoop opened this issue 2 years ago • 18 comments

Describe the bug I am attempting to add an enterprise github service to my lazygit config. After adding services config and still being unable to open a PR against the enterprise instance, I started testing other configurations to debug. It looks like none of those are being read in either.

My config and proof of config location

❯ cat /Users/john.smith/.config/lazygit/config.yml
gui:
  authorColors:
    'John Smith': 'green'
    '*': '#0000ff'
os:
  editCommand: 'vim'
services:
  'foo-github.com': 'github:foo-github.com'

❯ lazygit -cd
/Users/john.smith/.config/lazygit

To Reproduce Steps to reproduce the behavior:

  1. Check config directory with lazygit -cd
  2. Create a new config in $CONFIG_DIR/lazygit/config.yml
  3. Execut lazygit
  4. Create PR, and check URL in PR is pointing to your enterprise github instance

Expected behavior I'd expect that opening a PR uses the services config or errors if improperly configured.

Version info:

❯ lazygit --version
commit=, build date=, build source=homebrew, version=0.36.0, os=darwin, arch=amd64, git version=2.38.1
❯ git --version
git version 2.38.1

Additional context Add any other context about the problem here.

As a side note- I attempted to debug but the log file is not being created after running with --debug.

Note: please try updating to the latest version or manually building the latest master to see if the issue still occurs.

andscoop avatar Jan 31 '23 17:01 andscoop

Does it fail to start when there's an error in the config?

mark2185 avatar Feb 01 '23 11:02 mark2185

No, no failures or errors anywhere that I can see. It simply does not show any of the expected config changes.

andscoop avatar Feb 01 '23 16:02 andscoop

I think I'm wrong about the config not working. I actually am seeing author initials reflected in the same colors I have set in this config.

I am still not able to open a PR against our GHE instance though with this config.

andscoop avatar Feb 02 '23 02:02 andscoop

I'm having this issue currently on windows just tried settings and nothing happens just opens normal VIM no hotkey changes are working as well.

os:
	editCommand: 'nvim'
	

A-Lamia avatar Mar 08 '23 06:03 A-Lamia

@A-Lamia try using two spaces instead of tabs.

mark2185 avatar Mar 08 '23 06:03 mark2185

@mark2185 yeah still nothing sadly

A-Lamia avatar Mar 08 '23 06:03 A-Lamia

Could you post the path to your config, the entire config, and the output of running lazygit -cd?

mark2185 avatar Mar 08 '23 06:03 mark2185

path: C:\Users\Lamia\AppData\Roaming\lazygit\config.yml lazygit -cd: C:\Users\Lamia\AppData\Roaming\lazygit

config:

os:
  editCommand: 'nvim'
keybinding:
  appendNewLine: '<a-o>'

A-Lamia avatar Mar 08 '23 06:03 A-Lamia

Is nvim in the path? Try

keybinding.appendNewLine is sadly not used at all, try setting something that's visible right from the get go, e.g. the theme

gui:
  showIcons: true
  theme:
    activeBorderColor:
      - '#1eaeff'
      - bold

mark2185 avatar Mar 08 '23 06:03 mark2185

that is interesting the color changed, wait how is lazygit running the commands ?

EDIT: i tried neovide that is in my path and that did not work.

A-Lamia avatar Mar 08 '23 06:03 A-Lamia

It runs cmd /c nvim in the background.

mark2185 avatar Mar 08 '23 06:03 mark2185

yeah im not sure i tried neovide, nvim, vscode all of them can be launched from both cmd and powershell but vim is what it keeps openin.

EDIT: cmd /c nvim from the same terminal works fine as well.

A-Lamia avatar Mar 08 '23 06:03 A-Lamia

That's odd, it first checks for os.editCommand, and only if that's empty does it check git's editor and whatnot.

What does the log (bottom right panel) say after opening a file? cmd /c vim regardless of what you put in there?

mark2185 avatar Mar 08 '23 06:03 mark2185

open works fine, edit works fine but commit in editor is in VIM is this normal ?

A-Lamia avatar Mar 08 '23 06:03 A-Lamia

Yup, according to the source:

// runs git commit without the -m argument meaning it will invoke the user's editor
func (self *CommitCommands) CommitEditorCmdObj() oscommands.ICmdObj {
	return self.cmd.New(fmt.Sprintf("git commit%s%s", self.signoffFlag(), self.verboseFlag()))
}

mark2185 avatar Mar 08 '23 07:03 mark2185

yeah i just got everything working LOL sorry for bothering you.

my brain was tunneled on the commit part, i assumed that editCommand set the editor for everything and every time i made a change i was testing with the commit function

A-Lamia avatar Mar 08 '23 07:03 A-Lamia

I think for people like me who decide to leave there brain in the fridge when i woke up you should add something here https://github.com/jesseduffield/lazygit/blob/master/docs/Config.md#configuring-file-editing

about commit editor being ran with gits set editor. :)

A-Lamia avatar Mar 08 '23 07:03 A-Lamia

Well, it's not file editing per se, it's committing.

We could add this, but given the confusion regarding edit and commit, I doubt anyone would benefit from it:

    commitChanges: 'c' # commit with git's set editor

mark2185 avatar Mar 08 '23 07:03 mark2185