jesseduffield / jesseduffield/lazygit
LazyGit "freezes" after "commits" when used with Jetbrain IDE terminal (GoLand / PHPStorm)
- Dominant language
- Go
- Stars
- 82.4k
- Forks
- 3k
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 19
Description
**Describe the bug**
When I am using lazygit inside the terminal of GoLand (JetBrains IDE) and make a commit with the internal editor or a push, I end up with an "empty screen" and nothing happens any more (no CTRL-C nor other input will do something). The terminal is empty and dead. So I have to close the terminal and open a new one.
**Steps**
* Install GoLand
* Create a project
* Open Terminal
* Start lazygit (latest / master currently both have the problem)
* Mark something for a commit
* Use the internal commit editor
* Type message and some more info below
* Go back to the message and press enter.
* lazygit shows the output of the git command.
* press enter to continue
* The terminal clears and "does not come back".
* ctrl-c is not working
* killall lazygit (from another terminal) ends in a strange state. The prompt comes back but mouse movements are reported as esc codes into the terminal prompt.
* clearing that and running `reset` in the terminal recovers it.
**Version info:**
All versions so far, current installed one is "commit=5e388e21c8ca6aa883dbcbe45c47f6fdd5116815, build date=2023-08-07T14:05:48Z, build source=binaryRelease, version=0.40.2, os=darwin, arch=amd64, git version=2.41.0"
I also build master and tried that.
**Additional context**
My guess is that it hangs for some reason, and killing leaves the terminal in that state. I wonder that CTRL-C does not work. But I guess it is trapped at that moment.
Following the logs from commit to the "frozen" state.
```
Aug 18 22:51:51 |DEBU| RunCommand command="git add -A"
Aug 18 22:51:51 |INFO| git add -A (9.969672ms)
Aug 18 22:51:51 |INFO| refreshing the following scopes in sync mode: files
Aug 18 22:51:51 |INFO| refreshed merge conflicts in 14.614µs
Aug 18 22:51:51 |DEBU| using cache for key status.showUntrackedFiles
Aug 18 22:51:51 |DEBU| RunCommand command="git status --untracked-files=all --porcelain -z"
Aug 18 22:51:51 |INFO| git status --untracked-files=all --porcelain -z (9.316799ms)
Aug 18 22:51:51 |INFO| refreshed files in 9.681516ms
Aug 18 22:51:51 |INFO| Refresh took 9.741674ms
Aug 18 22:51:51 |INFO| postRefreshUpdate for submodules took 8.817µs
Aug 18 22:51:51 |INFO| postRefreshUpdate for files took 492.219µs
Aug 18 22:51:52 |DEBU| RunCommand command="git diff --submodule --no-ext-diff --unified=3 --color=always --cached -- front/front.go"
Aug 18 22:51:59 |INFO| refreshing all scopes in async mode
Aug 18 22:51:59 |DEBU| RunCommand command="git worktree list --porcelain"
Aug 18 22:51:59 |DEBU| using cache for key status.showUntrackedFiles
Aug 18 22:51:59 |DEBU| RunCommand command="git stash list -z --pretty=%gs"
Aug 18 22:51:59 |INFO| Refresh took 271.492µs
Aug 18 22:51:59 |DEBU| RunCommand command="git status --untracked-files=all --porcelain -z"
Aug 18 22:51:59 |DEBU| RunCommand command="git merge-base HEAD HEAD@{u}"
Aug 18 22:51:59 |DEBU| RunCommand command="git tag --list -n --sort=-creatordate"
Aug 18 22:51:59 |DEBU| RunCommand command="git merge-base HEAD refs/remotes/origin/master"
Aug 18 22:51:59 |INFO| git worktree list --porcelain (12.671733ms)
Aug 18 22:51:59 |INFO| git -c log.showSignature=false log -g --abbrev=40 --format=%h%x00%ct%x00%gs%x00%p (13.646767ms)
Aug 18 22:51:59 |INFO| git stash list -z --pretty=%gs (12.522949ms)
Aug 18 22:51:59 |INFO| git branch -r (12.996989ms)
Aug 18 22:51:59 |INFO| postRefreshUpdate for stash took 20.571µs
Aug 18 22:51:59 |INFO| postRefreshUpdate for remotes took 67.338µs
Aug 18 22:51:59 |INFO| postRefreshUpdate for remoteBranches took 5.396µs
Aug 18 22:51:59 |INFO| postRefreshUpdate for localBranches took 362.164µs
Aug 18 22:51:59 |INFO| postRefreshUpdate for reflogCommits took 471.088µs
Aug 18 22:51:59 |INFO| postRefreshUpdate for worktrees took 42.168µs
Aug 18 22:51:59 |DEBU| RunCommand command="git for-each-ref --sort=-committerdate --format=%(HEAD)%00%(refname:short)%00%(upstream:short)%00%(upstream:track)%00%(subject)%00%(objectname) refs/heads"
Aug 18 22:51:59 |INFO| git log HEAD --topo-order --oneline --pretty=format:%H%x00%at%x00%aN%x00%ae%x00%D%x00%p%x00%s --abbrev=40 -300 --no-show-signature -- (17.373382ms)
Aug 18 22:51:59 |INFO| git status --untracked-files=all --porcelain -z (11.323971ms)
Aug 18 22:51:59 |INFO| git merge-base HEAD HEAD@{u} (11.88642ms)
Aug 18 22:51:59 |INFO| git tag --list -n --sort=-creatordate (11.302043ms)
Aug 18 22:51:59 |INFO| postRefreshUpdate for tags took 16.672µs
Aug 18 22:51:59 |INFO| git merge-base HEAD refs/remotes/origin/master (11.970242ms)
Aug 18 22:51:59 |DEBU| RunCommand command="git rev-parse --abbrev-ref --verify HEAD"
Aug 18 22:51:59 |INFO| git for-each-ref --sort=-committerdate --format=%(HEAD)%00%(refname:short)%00%(upstream:short)%00%(upstream:track)%00%(subject)%00%(objectname) refs/heads (9.696731ms)
Aug 18 22:51:59 |INFO| postRefreshUpdate for localBranches took 114.88µs
Aug 18 22:51:59 |DEBU| using cache for key rebase.updateRefs
Aug 18 22:51:59 |INFO| git rev-parse --abbrev-ref --verify HEAD (7.514443ms)
Aug 18 22:51:59 |DEBU| using cache for key rebase.updateRefs
Aug 18 22:51:59 |INFO| postRefreshUpdate for commits took 180.771µs
Aug 18 22:52:04 |INFO| refreshing the following scopes in sync mode: files
Aug 18 22:52:04 |DEBU| using cache for key status.showUntrackedFiles
Aug 18 22:52:04 |INFO| refreshed merge conflicts in 24.602µs
Aug 18 22:52:04 |DEBU| RunCommand command="git status --untracked-files=all --porcelain -z"
Aug 18 22:52:04 |INFO| git status --untracked-files=all --porcelain -z (9.887593ms)
Aug 18 22:52:04 |INFO| refreshed files in 10.235143ms
Aug 18 22:52:04 |INFO| Refresh took 10.357353ms
```
It then repeats the last part of the log. So it is still running and has "control". It just seems that the terminal is having a hard time with what lazygit does. Some co-workers have the same problem. There is also the rumor that it sometimes work ... but I actually can't really remember that it worked for me at times.
P.S.: I am sure it is a problem with the JetBrains implementation. But can it be fixed on your side?
Contributor guide
Assessment
This issue has not been assessed yet.