Cannot cancel gitbash running task #2991

Closed
opened 2026-01-30 23:10:21 +00:00 by claunia · 4 comments
Owner

Originally created by @samuelkdavis-mccarthyfinch on GitHub (Jul 30, 2019).

Environment

Windows build number: 18362.239
Windows Terminal version (if applicable): 0.2.1.18831.0

Any other software?

Git bash with the profile:
        {
            "acrylicOpacity" : 0.5,
            "closeOnExit" : true,
            "colorScheme" : "Campbell",
            "commandline" : "C:\\Program Files\\Git\\bin\\bash.exe",
            "icon" : "C:\\Program Files\\Git\\mingw64\\share\\git\\git-for-windows.ico",
            "name" : "Git Bash",
            "startingDirectory" : "%HOMEDRIVE%%HOMEPATH%",
            "cursorColor" : "#FFFFFF",
            "cursorShape" : "bar",
            "fontFace" : "Consolas",
            "fontSize" : 10,
            "guid" : "{9a3f80c4-d840-4781-a7d3-84f6c7c9dd7c}",
            "historySize" : 9001,
            "padding" : "0, 0, 0, 0",
            "snapOnInput" : true,
            "useAcrylic" : false
        },

Python 3.6.8-amd64

Steps to reproduce

Set up gitbash with the json above. Run a long-running task in the current window. Ctrl+c doesn't kill the task

Expected behavior

ctrl+c should kill the task

Actual behavior

Cannot regain control over the current window.

Originally created by @samuelkdavis-mccarthyfinch on GitHub (Jul 30, 2019). <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 I ACKNOWLEDGE THE FOLLOWING BEFORE PROCEEDING: 1. If I delete this entire template and go my own path, the core team may close my issue without further explanation or engagement. 2. If I list multiple bugs/concerns in this one issue, the core team may close my issue without further explanation or engagement. 3. If I write an issue that has many duplicates, the core team may close my issue without further explanation or engagement (and without necessarily spending time to find the exact duplicate ID number). 4. If I leave the title incomplete when filing the issue, the core team may close my issue without further explanation or engagement. 5. If I file something completely blank in the body, the core team may close my issue without further explanation or engagement. All good? Then proceed! --> <!-- This bug tracker is monitored by Windows Terminal development team and other technical folks. **Important: When reporting BSODs or security issues, DO NOT attach memory dumps, logs, or traces to Github issues**. Instead, send dumps/traces to secure@microsoft.com, referencing this GitHub issue. Please use this form and describe your issue, concisely but precisely, with as much detail as possible. --> # Environment ```none Windows build number: 18362.239 Windows Terminal version (if applicable): 0.2.1.18831.0 Any other software? Git bash with the profile: { "acrylicOpacity" : 0.5, "closeOnExit" : true, "colorScheme" : "Campbell", "commandline" : "C:\\Program Files\\Git\\bin\\bash.exe", "icon" : "C:\\Program Files\\Git\\mingw64\\share\\git\\git-for-windows.ico", "name" : "Git Bash", "startingDirectory" : "%HOMEDRIVE%%HOMEPATH%", "cursorColor" : "#FFFFFF", "cursorShape" : "bar", "fontFace" : "Consolas", "fontSize" : 10, "guid" : "{9a3f80c4-d840-4781-a7d3-84f6c7c9dd7c}", "historySize" : 9001, "padding" : "0, 0, 0, 0", "snapOnInput" : true, "useAcrylic" : false }, Python 3.6.8-amd64 ``` # Steps to reproduce Set up gitbash with the json above. Run a long-running task in the current window. Ctrl+c doesn't kill the task # Expected behavior ctrl+c should kill the task # Actual behavior Cannot regain control over the current window.
claunia added the Needs-TriageResolution-ExternalNeeds-Tag-Fix labels 2026-01-30 23:10:21 +00:00
Author
Owner

@samuelkdavis-mccarthyfinch commented on GitHub (Jul 30, 2019):

Opening a new gitbash tab, running ps to find the process id, then running kill 1234123 fixes the first tab

@samuelkdavis-mccarthyfinch commented on GitHub (Jul 30, 2019): Opening a new gitbash tab, running `ps` to find the process id, then running `kill 1234123` fixes the first tab
Author
Owner

@samuelkdavis-mccarthyfinch commented on GitHub (Jul 30, 2019):

This could be the cause...

https://stackoverflow.com/questions/45987985/asyncio-loops-add-signal-handler-in-windows

@samuelkdavis-mccarthyfinch commented on GitHub (Jul 30, 2019): This could be the cause... https://stackoverflow.com/questions/45987985/asyncio-loops-add-signal-handler-in-windows
Author
Owner

@samuelkdavis-mccarthyfinch commented on GitHub (Jul 30, 2019):

After a bit of investigation, it does seem to be an issue specifically with asyncio. I'm not sure if there's anything the terminal can do to regain control from runaway asyncio loops. Feel free to close this if there aren't any viable ways to control this from a terminal level.

@samuelkdavis-mccarthyfinch commented on GitHub (Jul 30, 2019): After a bit of investigation, it does seem to be an issue specifically with asyncio. I'm not sure if there's anything the terminal can do to regain control from runaway asyncio loops. Feel free to close this if there aren't any viable ways to control this from a terminal level.
Author
Owner

@zadjii-msft commented on GitHub (Jul 30, 2019):

Yea, this looks like it's out of our control. Fundamentally, the terminal is just a frontend for the Console API, so asynchio would need to find a better way to deal with this.

I'm kinda surprised they don't implement a windows-specific version of add_signal_handler that adds a ConsoleCtrlEvent handler, but I don't really know the specifcs of why they may have chosen not to do that.

@zadjii-msft commented on GitHub (Jul 30, 2019): Yea, this looks like it's out of our control. Fundamentally, the terminal is just a frontend for the Console API, so asynchio would need to find a better way to deal with this. I'm kinda surprised they don't implement a windows-specific version of `add_signal_handler` that adds a ConsoleCtrlEvent handler, but I don't really know the specifcs of why they may have chosen not to do that.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#2991