lazygit: Lazygit hangs on any custom command
Describe the bug
When I call any custom command using : it is stuck on “Press enter to return to lazygit” when I call it from Neovim. However, when I call it directly from the Terminal (kitty) like:
/some/repo
> lazygit
+ /bin/zsh -i -c git fetch origin develop
From github.com:some/repo
* branch develop -> FETCH_HEAD
[1] + 50708 suspended (tty output) lazygit
> …/some/repo ✖ TTOU 7s
> fg
[1] + 50708 continued lazygit
it’s stuck, lazygit doesn’t appear. I can’t do anything, I have to kill the terminal.
Environment
> lazygit --version
commit=, build date=, build source=nix, version=0.44.1, os=darwin, arch=arm64, git version=2.46.0
> git --version
git version 2.46.0
Additional context
I’m using Nix and I noticed that lazygit calls wrong zsh instance. It should use the first one:
> where zsh
/etc/profiles/per-user/me/zsh
/run/current-system/sw/bin/zsh
/bin/zsh
but it uses the last one. I’m not sure if it matters.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 1
- Comments: 18 (3 by maintainers)
@hglbrg-sli the same issue occurs when lazygit is called directly from the terminal (not from Neovim)
I’m having the same problem when running shell commands. Keeps hanging in
Press enter to continueand doesn’t leave, I have to kill lazygit to be able to leave the screen.I have been using this method for days. And it works fine for me. I’m not sure if it’s the correct way to fix it, but it works.
Here’s a PR: #4126. Could those affected by the problem please test it? Thanks!
After querying GTP, I got the
exitsolution. I’ve tried multiple commands and it works well.Can you guys try it out?
run
<your command>; exitin lazygit instead.Has the same issue starting from v0.44.0 downdrade to v0.43.1 solve the problem
Based on your logs it’s suspended. What happens if you run
fgafter that? In my case it’s not going back to lazygit but it’s freezedIt gets suspended, not killed, you can bring it up with
fg.But yes, same issue.
Apologies if this is the same issue, but I’m running into almost exactly the same issue except my terminal (wezterm) is not freezing. Lazygit is simply being killed after running a custom command, and I have to reopen it.