-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Add support for suspending LazyGit with Ctrl+Z on Unix systems #4757
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
@stefanhaller Iβve addressed the earlier issues you pointed out. Iβm not sure if a test is needed for this change, or if there are any other steps youβd expect before merging. Let me know! π |
@cowboy8625 The behavior is still the same for me, as described in #3906 (comment). After typing bg, I get the "+ suspended (tty output)" error, and then (We had a similar problem back when we used And finally, when I use Until these problems are solved I don't feel we can merge this. But I'm also not sure how much time is justified for putting into this, to be honest. |
@stefanhaller I was able to better handle the issue where running Hereβs how it looks now on macOS (Kitty terminal):![]() And hereβs how Neovim behaves:![]() I also resolved the issue that happened when running via Previously, I was only sending a stop signal to the lazygit process itself, which doesnβt work properly if itβs launched inside a wrapper or Thanks a lot for your help! |
- Remove old-style build tags (the +build syntax has become obsolete with 1.17) - Remove redundant build tags from '*_windows.go' files
This should have been removed in 8c574f8, where I renamed it back to 'gui' to fix a linter warning.
This frees up ctrl-z for suspend. Hopefully, redo is not such a frequently used operation that the change annoys people. Co-authored-by: Stefan Haller <stefan@haller-berlin.de>
These suspend/resume the gocui layer and pause/unpause background refreshes.
Co-authored-by: Stefan Haller <stefan@haller-berlin.de>
Nice, seems like we're getting somewhere with this. π I had to make quite a few changes, and I took the opportunity to also restructure the commits to make them reviewable. I didn't want to force-push your master branch, so I pushed a new branch A few notes about what I changed:
During testing I still had one or two cases where lazygit didn't come back to the foreground after typing |
Yeah, this is a lot cleaner. |
@stefanhaller Am I good to open this up for review? π |
I'd say so, yes. I'll hold off merging this for now until after we released 0.54.1, which I expect to happen tomorrow or the day after; that's a hotfix (needed because of #4793), and I don't want to include any other changes there. To be honest I don't really fully understand what we're doing here when we wake up, like what this But it seems to work well, so I'm fine with going with this for now. |
To my knowledge this is the most reliable way to handle it. By opening |
β¨ Add Ctrl+Z suspend support for LazyGit on Unix-like systems
π Summary
This PR adds support for suspending LazyGit when the user presses
Ctrl+Z
, making it behave like common CLI tools (e.g., Vim, less, htop):Ctrl+Z
sends aSIGTSTP
signal to suspend LazyGit.fg
, LazyGit redraws and continues working without hanging.β Motivation
Make LazyGit feel more native on Unix-like systems by supporting standard terminal suspend/resume (Ctrl+Z / fg) behavior.
go generate ./...
)Closes #3906