jesseduffield / jesseduffield/lazygit
LazyGit gets stuck when aborting a commit w/ empty message
- Dominant language
- Go
- Stars
- 82.4k
- Forks
- 3k
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 19
Description
**Describe the bug**
LazyGit (LG) will get stuck when a commit is aborted due to an empty message. Pressing `` or even `Ctrl+C` in the terminal fails to return back to the LG session.
**To Reproduce**
1. In LG, press the keybind to `Commit changes using git editor`.
2. Remove text to ensure an empty commit message.
3. Save and exit from the git editor, which should cause Git to abort the commit.
4. You will be returned back to the `Press enter to return to lazygit` prompt.
5. Get stuck here.
**Expected behavior**
Expected to actually return back to LG.
**Screenshots**

Note that the `^M` and `^C` characters in the screenshot are my attempts to return back to LG.
**Version info:**
LG Version: `commit=71ad3fac63a3ef3326021837b49e9497d332818b, build date=2024-07-13T10:24:19Z, build source=binaryRelease, version=0.43.1, os=linux, arch=amd64, git version=2.43.0`
Git Version: `git version 2.43.0`
**Additional context**
The only way to get out of that LG state was to go into another terminal, find LG's PID, and then `kill -SIGTERM `.
In addition, in an attempt to provide logs, I ran `lazygit --debug` in one terminal and `lazygit --logs` in another, and while running in debug mode, I was unable to reproduce the error. In this case, it correctly showed that there was an error exit code of 1 and I'm able to go return to the LG session.

Lastly, notice that in the normal case, the message `Press enter to return to lazygit` shows up on the left side of the screen, but on the error case, the message showed up closer to the center of the screen. Not sure if this is or isn't related, but worth mentioning just in case.

Contributor guide
Assessment
This issue has not been assessed yet.