-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Ctrl+C kills background git processes on git bash #950
Comments
I fear that there is not a whole lot we can do about this. You see, there is no such thing as a "background process" on Windows. They are all alike. So when we kill a process using Ctrl+C, we have to traverse all of its children, too, in order to kill non-background processes correctly. But of course, as we have no way to discern between background and non-background processes, we just kill 'em all... |
A fix for this should be an incidental fallout of my upcoming fix for #1491. |
The newest snapshot at https://wingit.blob.core.windows.net/files/index.html should fix this. Please test. |
The issue is fixed on the latest release (PortableGit-2.20.1-32-bit.7z.exe). But this doesn't seems to be a fallout of #1491, after testing many releases from https://wingit.blob.core.windows.net/files/index.html, I can tell the first release which fixes the issue is this one : The previous release still had the bug : And this is pretty weird because there is so little difference between these two versions, according to git : |
Please note that Git for Windows consists of more than just the build output for the Git source code. It contains parts of well over 100 packages, among them the MSYS2 runtime that is actually responsible for handling Ctrl+C in Git Bash. If you compare the files |
Setup
(Windows 7 64-bit)
defaults?
I have no install-options.txt file.
I'm using a portable release : PortableGit-prerelease-2.11.0.rc0.windows.1-32-bit.7z.exe
Details
Bash
Minimal, Complete, and Verifiable example
this will help us understand the issue.
I expect to keep gitk running, because it is a background process.
gitk gets killed by Ctrl+C
Additionnal notes
This is not specific to
git bisect visualize
, this issue seems to apply on all programs launched from git, such asgit difftool
(I chose to showgit bisect visualize
in my example simply because it does not need a custom git configuration, unlike git difftool).Furthermore, I also tested on linux, without meeting the issue (gitk keeps running).
After a few search on the internet, I suspect the PGID (bash process groups) to be responsible for the issue :
Here are different processes running (after a
git bisect visualize &
) :You can see that /mingw32/bin/wish (the process holding gitk) has the same PGID than bash (11444).
The same test on linux shows that the PGID is different :
The text was updated successfully, but these errors were encountered: