Ctrl+C not working with gradle in Git Bash 2.20.1
Asked Answered
H

1

10

Back in Windows 7, Ctrl+C worked fine for killing tasks such as gradle. On Windows 10, it does not. I upgraded to Git Bash 2.20.1, where it claims it is fixed (can't find a web link, the release notes are part of the instal package and viewed locally).

Ctrl+C is now handled in Git Bash in a sophisticated way: it emulates the way Ctrl+C is handled in Git CMD, but in a fine-grained way.

Ctrl+C still doesn't work for me. I launch git bash by right clicking a folder in Explorer, and choosing "Git Bash Here"

Ctrl+C seems to work when i'm on the bash terminal idle (without a task running), but gradle for example is unresponsive to Ctrl+C.

Hann answered 23/1, 2019 at 13:9 Comment(3)
Check that Explorer is calling the newer version and is not still linked to the previous one.Psychiatry
It's calling C:\Program Files\Git\git-bash.exe, dated 12/15/2018. I only have one version installed. When I ran the installer, it looked like it just upgraded the git-bash I previously had installed.Hann
Could it be possible that gradle is ignoring Ctrl+C? I don't know the details for Windows, but I know on Linux, a program can provide its own SIGINT handler, and can choose not to terminate if they receive a SIGINT. For example, if you start a python interactive session, a Ctrl+C will not kill the process (at least on Linux).Mg
H
-2

Try using just the exit command.

Hugues answered 15/1, 2022 at 2:59 Comment(2)
As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.Mylesmylitta
When gradle is running and not responding to Ctrl-C, there is no prompt available in which to type the exit command.Vitia

© 2022 - 2024 — McMap. All rights reserved.