microsoft / terminal

The new Windows Terminal and the original Windows console host, all in the same place!
MIT License
95.96k stars 8.35k forks source link

[process exited with code 3221225477] at exiting console-programs like diskpart #7292

Closed logg-sar closed 4 years ago

logg-sar commented 4 years ago

Environment

Windows build number: Microsoft Windows [Version 10.0.18363.959]
Windows Terminal version (if applicable): 1.1.2021.0 (but not only)

Steps to reproduce

Open cmd with admin rights. Start diskpart (enter for example list disk) Quit diskpart by pressing CTRL-C

Expected behavior

Diskpart is closed an using Terminal is posible

Actual behavior

After some seconds this appear:

[process exited with code 3221225477] and Terminal is no longer usable

Same behaviour with netsh

DHowett commented 4 years ago

image

Can you share your settings.json?

ghost commented 4 years ago

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

logg-sar commented 4 years ago

Of course

// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation

{
    "$schema": "https://aka.ms/terminal-profiles-schema",

    "defaultProfile": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",

    "profiles":
    {
        "defaults":
        {
            // Put settings here that you want to apply to all profiles
            "fontFace": "Consolas",
            "cursorShape": "vintage",
            // If enabled, selections are automatically copied to your clipboard.
            "copyOnSelect": true,
            // If enabled, formatted data is also copied to your clipboard
            "copyFormatting": false
        },
        "list":
        [
            {
                // Make changes here to the powershell.exe profile
                "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
                "name": "Windows PowerShell",
                "commandline": "powershell.exe",
                "hidden": false
            },
            {
                // Make changes here to the powershell.exe profile
                "guid": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
                "name": "ADMIN PowerShell âš¡",
                "commandline": "gsudo powershell.exe",
                "icon": "ms-appdata:///roaming/pwsh-32.png",
                "hidden": false
            },
            {
                // Make changes here to the cmd.exe profile
                "guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
                "name": "cmd",
                "commandline": "cmd.exe",
                "hidden": false
            },{
                // Make changes here to the cmd.exe profile
                "guid": "{c6eaf9f4-32a7-5fdc-b5cf-066e8a4b1e40}",
                "name": "ADMIN cmd âš¡",
                "commandline": "gsudo cmd.exe",
                "icon": "ms-appdata:///roaming/terminal.ico",
                "hidden": false
            },
            {
                "guid": "{b453ae62-4e3d-5e58-b989-0a998ec441b8}",
                "hidden": false,
                "name": "Azure Cloud Shell",
                "source": "Windows.Terminal.Azure"
            },
            {
                "guid": "{58ad8b0c-3ef8-5f4d-bc6f-13e4c00f2530}",
                "hidden": false,
                "name": "Debian",
                "source": "Windows.Terminal.Wsl",
                "startingDirectory": "//wsl$/Debian/mnt/"
            }
        ]
    },

    // Add custom color schemes to this array
    "schemes": [],

    // Add any keybinding overrides to this array.
    // To unbind a default keybinding, set the command to "unbound"
    "keybindings": [
        {"command": {"action": "switchToTab", "index": 0}, "keys": "alt+1"},
        {"command": {"action": "switchToTab", "index": 1}, "keys": "alt+2"},
        {"command": {"action": "switchToTab", "index": 2}, "keys": "alt+3"},
        {"command": {"action": "switchToTab", "index": 3}, "keys": "alt+4"},
        {"command": {"action": "switchToTab", "index": 4}, "keys": "alt+5"},
        {"command": {"action": "switchToTab", "index": 5}, "keys": "alt+6"},
        {"command": {"action": "switchToTab", "index": 6}, "keys": "alt+7"},
        {"command": {"action": "switchToTab", "index": 7}, "keys": "alt+8"},
        {"command": {"action": "switchToTab", "index": 8}, "keys": "alt+9"},
        {"command": "moveFocusLeft", "keys": ["ctrl+shift+left"]},
            {"command": "moveFocusRight", "keys": ["ctrl+shift+right"]},
            {"command": "moveFocusUp", "keys": ["ctrl+shift+up"]},
            {"command": "moveFocusDown", "keys": ["ctrl+shift+down"]},      
        {"command": "find", "keys": "ctrl+f"},
        {"command": "paste", "keys": "ctrl+v"},
        {"command": "paste", "keys": "ctrl+shift+v"},
        {"command": "newTab", "keys": "ctrl+t"},
    //  {"command": "closeTab", "keys": "ctrl+w"},
        {"command": "closeWindow", "keys": "alt+f4"},
        {"command": {"action": "copy", "singleLine": false}, "keys": "alt+enter"},
        {"command": {"action": "copy", "singleLine": false}, "keys": "ctrl+enter"},
        {"command": "duplicateTab", "keys": "ctrl+shift+d"},
        {"command": "closePane", "keys": "ctrl+shift+w"},       
        {"command": "nextTab", "keys": "ctrl+tab"},
        {"command": {"action": "splitPane", "split": "auto", "splitMode": "duplicate" }, "keys": "ctrl+shift+t" }
    ]
}

Hope nothings wrong in it...

KalleOlaviNiemitalo commented 4 years ago

Does the problem occur only in those profiles that use gsudo?

Perhaps the GenerateConsoleCtrlEvent calls in CtrlCCommand.cs are causing this somehow. I am not sure that class is used nowadays, though; most references to it are in obsolete classes.

netxph commented 4 years ago

I also have the same issue. Not only with gsudo, but with dotnet watch test, jupyter notebook and this only happens when I press CTRL+C. One additional thing, this only happens with PowerShell Core pwsh.

Windows Powershell seems to be working fine.

DHowett commented 4 years ago

You are seeing a very common issue caused by powershell core 6 or scoop. They both have the same problem. Upgrade or stop using scoop.

netxph commented 4 years ago

Cool thanks... My pwsh 7.0.3 is installed through scoop, and I am now using the one from the installer. It's now working.

It might be the shimming mechanism of scoop that's producing this issue. Still, I hope this gets resolved. Thanks.

DHowett commented 4 years ago

It is definitely the shimming mechanism 😄 and there are many threads about this issue on the Scoop repo!

logg-sar commented 4 years ago

Does the problem occur only in those profiles that use [gsudo]?

Yes, you are right. I'll abandon gsudo.

Closed (at least for me ;))

gerardog commented 4 years ago

I just noticed this thread. This was fixed on Aug 9 on gsudo v0.7.2 (The Control-C handler delegate was being garbage collected).

DHowett commented 4 years ago

That's two weird console-related garbage collection issues! If you want to write a blog post about it, I'll signal-boost :smile: