jesseduffield / lazygit

simple terminal UI for git commands
MIT License
51.84k stars 1.82k forks source link

Lazygit hangs on any custom command #3937

Open wojciech-kulik opened 2 weeks ago

wojciech-kulik commented 2 weeks ago

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.

stefanhaller commented 2 weeks ago

This is a duplicate of #3903 (and #3923).

I'm using Nix and I noticed that lazygit calls wrong zsh instance. It should use the first one: but it uses the last one. I'm not sure if it matters.

It probably doesn't matter for this issue, but just to explain this one: lazygit uses whatever your $SHELL environment variable is set to (and it seems to be /bin/zsh). It doesn't look for zsh in your PATH.

wojciech-kulik commented 2 weeks ago

Thank you for details! I'm waiting for the fix then 🤞

mayorbyrne commented 2 weeks ago

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.

+ /bin/zsh -i -c git pull

Already up to date.

Press enter to return to lazygit[3]  + 13839 suspended (tty input)  lazygit
~/Documents/myRepo $
mark2185 commented 2 weeks ago

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.

It gets suspended, not killed, you can bring it up with fg.

But yes, same issue.

wojciech-kulik commented 2 weeks ago

Based on your logs it’s suspended. What happens if you run fg after that? In my case it’s not going back to lazygit but it’s freezed

mayorbyrne commented 2 weeks ago

ah, yes. Confirmed that running fg afterwards results in [1] + 4381 continued lazygit with a hanging blinking cursor.

that said, if I run exit then, it does go back to lazygit