Skip to content
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

Can't reopen Windows Terminal #17360

Closed
SpecterShell opened this issue Jun 4, 2024 · 8 comments · Fixed by #18215
Closed

Can't reopen Windows Terminal #17360

SpecterShell opened this issue Jun 4, 2024 · 8 comments · Fixed by #18215
Labels
Area-Remoting Communication layer between windows. Often for windowing behavior, quake mode, etc. In-PR This issue has a related PR Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Attention The core contributors need to come back around and look at this ASAP. Needs-Tag-Fix Doesn't match tag requirements Product-Terminal The new Windows Terminal.

Comments

@SpecterShell
Copy link

SpecterShell commented Jun 4, 2024

Windows Terminal version

1.20.11381.0

Windows build number

10.0.22631.0

Other Software

No response

Steps to reproduce

In Windows Terminal 1.20.11381.0 (delivered by Microsoft Store), when a window is being closed, it appears not to be properly "unregistered", so the process still thinks it is alive, and it is still present in the context menu like this:

image

This would bring issues when the "New instance behavior" is set to "Attach to most recently used window on this desktop". No window will pop up when you try to open a new console or run console applications after a window is closed, even if I'm in a different desktop.

  1. Set "New instance behavior" to "Attach to most recently used window on this desktop" and close the window.
  2. Open a new window in either way.

Expected Behavior

No response

Actual Behavior

The process didn't crash, but it just rejects to open a new window for me.

When opening a console application, the Windows Terminal window doesn't pop up either, and about 1 minute later the conhost window pop up.

Quake mode still works, and I can open a new window by pressing Ctrl+Shift+N there, but it doesn't fix the issue.

@SpecterShell SpecterShell added Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Jun 4, 2024
@zadjii-msft
Copy link
Member

Could you share your settings.json file/?

@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Jun 4, 2024
@SpecterShell
Copy link
Author

SpecterShell commented Jun 4, 2024

{
    "$help": "https://aka.ms/terminal-documentation",
    "$schema": "https://aka.ms/terminal-profiles-schema",
    "actions": 
    [
        {
            "command": "find",
            "keys": "f3"
        },
        {
            "command": 
            {
                "action": "quakeMode"
            },
            "keys": "ctrl+alt+q"
        },
        {
            "command": "unbound",
            "keys": "win+sc(41)"
        }
    ],
    "alwaysShowNotificationIcon": true,
    "compatibility.allowHeadless": true,
    "defaultProfile": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
    "initialCols": 100,
    "initialRows": 40,
    "newTabMenu": 
    [
        {
            "type": "remainingProfiles"
        }
    ],
    "profiles": 
    {
        "defaults": 
        {
            "bellStyle": 
            [
                "audible",
                "taskbar"
            ],
            "colorScheme": "idleToes",
            "font": 
            {
                "face": "Sarasa Term SC Nerd",
                "size": 11.0
            },
            "padding": "0",
            "useAcrylic": false,
            "useAtlasEngine": true
        },
        "list": 
        [
            {
                "guid": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
                "hidden": false,
                "name": "PowerShell",
                "source": "Windows.Terminal.PowershellCore"
            },
            {
                "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
                "name": "Windows PowerShell"
            },
            {
                "guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
                "name": "cmd"
            },
            {
                "closeOnExit": "always",
                "guid": "{a5a97cb8-8961-5535-816d-772efe0c6a3f}",
                "hidden": false,
                "icon": "%OneDriveConsumer%\\Apps\\Terminal\\Arch Linux.ico",
                "name": "Arch Linux",
                "source": "Windows.Terminal.Wsl"
            },
            {
                "closeOnExit": "always",
                "commandline": "cmd /S /C C:\\msys64\\msys2_shell.cmd -defterm -no-start -shell zsh -msys2",
                "guid": "{bb77b932-6453-4499-a6dd-a5b708e81bfe}",
                "icon": "C:\\msys64\\msys2.ico",
                "name": "MSYS2",
                "startingDirectory": "%USERPROFILE%"
            },
            {
                "closeOnExit": "always",
                "commandline": "cmd /S /C C:\\msys64\\msys2_shell.cmd -defterm -no-start -shell zsh -mingw64",
                "guid": "{cb00d580-4cae-40e1-8bb2-fd149049283e}",
                "icon": "C:\\msys64\\mingw64.ico",
                "name": "MSYS2 MinGW64",
                "startingDirectory": "%USERPROFILE%"
            },
            {
                "closeOnExit": "always",
                "commandline": "cmd /S /C C:\\msys64\\msys2_shell.cmd -defterm -no-start -shell zsh -ucrt64",
                "guid": "{18246bb5-45c1-49a8-835c-8cd43c94a34c}",
                "icon": "C:\\msys64\\ucrt64.ico",
                "name": "MSYS2 UCRT64",
                "startingDirectory": "%USERPROFILE%"
            },
            {
                "guid": "{40dfbf43-05c0-576e-ac71-19a2d62e7f9c}",
                "hidden": false,
                "name": "Developer PowerShell for VS 2022",
                "source": "Windows.Terminal.VisualStudio"
            },
            {
                "guid": "{81e8e934-0b50-53d9-a5f6-de5157db92f3}",
                "hidden": false,
                "name": "Developer Command Prompt for VS 2022",
                "source": "Windows.Terminal.VisualStudio"
            },
            {
                "guid": "{b453ae62-4e3d-5e58-b989-0a998ec441b8}",
                "hidden": true,
                "name": "Azure Cloud Shell",
                "source": "Windows.Terminal.Azure"
            },
            {
                "guid": "{bf91144a-ab5a-57b2-a264-f4c270fa65b9}",
                "hidden": false,
                "name": "zhuoyi-Ubuntu-20.04",
                "source": "Windows.Terminal.Wsl"
            }
        ]
    },
    "schemes": 
    [
        {
            "background": "#0C0C0C",
            "black": "#0C0C0C",
            "blue": "#0037DA",
            "brightBlack": "#767676",
            "brightBlue": "#3B78FF",
            "brightCyan": "#61D6D6",
            "brightGreen": "#16C60C",
            "brightPurple": "#B4009E",
            "brightRed": "#E74856",
            "brightWhite": "#F2F2F2",
            "brightYellow": "#F9F1A5",
            "cursorColor": "#FFFFFF",
            "cyan": "#3A96DD",
            "foreground": "#CCCCCC",
            "green": "#13A10E",
            "name": "Campbell",
            "purple": "#881798",
            "red": "#C50F1F",
            "selectionBackground": "#FFFFFF",
            "white": "#CCCCCC",
            "yellow": "#C19C00"
        },
        {
            "background": "#012456",
            "black": "#0C0C0C",
            "blue": "#0037DA",
            "brightBlack": "#767676",
            "brightBlue": "#3B78FF",
            "brightCyan": "#61D6D6",
            "brightGreen": "#16C60C",
            "brightPurple": "#B4009E",
            "brightRed": "#E74856",
            "brightWhite": "#F2F2F2",
            "brightYellow": "#F9F1A5",
            "cursorColor": "#FFFFFF",
            "cyan": "#3A96DD",
            "foreground": "#CCCCCC",
            "green": "#13A10E",
            "name": "Campbell Powershell",
            "purple": "#881798",
            "red": "#C50F1F",
            "selectionBackground": "#FFFFFF",
            "white": "#CCCCCC",
            "yellow": "#C19C00"
        },
        {
            "background": "#282C34",
            "black": "#282C34",
            "blue": "#61AFEF",
            "brightBlack": "#5A6374",
            "brightBlue": "#61AFEF",
            "brightCyan": "#56B6C2",
            "brightGreen": "#98C379",
            "brightPurple": "#C678DD",
            "brightRed": "#E06C75",
            "brightWhite": "#DCDFE4",
            "brightYellow": "#E5C07B",
            "cursorColor": "#FFFFFF",
            "cyan": "#56B6C2",
            "foreground": "#DCDFE4",
            "green": "#98C379",
            "name": "One Half Dark",
            "purple": "#C678DD",
            "red": "#E06C75",
            "selectionBackground": "#FFFFFF",
            "white": "#DCDFE4",
            "yellow": "#E5C07B"
        },
        {
            "background": "#FAFAFA",
            "black": "#383A42",
            "blue": "#0184BC",
            "brightBlack": "#4F525D",
            "brightBlue": "#61AFEF",
            "brightCyan": "#56B5C1",
            "brightGreen": "#98C379",
            "brightPurple": "#C577DD",
            "brightRed": "#DF6C75",
            "brightWhite": "#FFFFFF",
            "brightYellow": "#E4C07A",
            "cursorColor": "#4F525D",
            "cyan": "#0997B3",
            "foreground": "#383A42",
            "green": "#50A14F",
            "name": "One Half Light",
            "purple": "#A626A4",
            "red": "#E45649",
            "selectionBackground": "#FFFFFF",
            "white": "#FAFAFA",
            "yellow": "#C18301"
        },
        {
            "background": "#002B36",
            "black": "#002B36",
            "blue": "#268BD2",
            "brightBlack": "#073642",
            "brightBlue": "#839496",
            "brightCyan": "#93A1A1",
            "brightGreen": "#586E75",
            "brightPurple": "#6C71C4",
            "brightRed": "#CB4B16",
            "brightWhite": "#FDF6E3",
            "brightYellow": "#657B83",
            "cursorColor": "#FFFFFF",
            "cyan": "#2AA198",
            "foreground": "#839496",
            "green": "#859900",
            "name": "Solarized Dark",
            "purple": "#D33682",
            "red": "#DC322F",
            "selectionBackground": "#FFFFFF",
            "white": "#EEE8D5",
            "yellow": "#B58900"
        },
        {
            "background": "#FDF6E3",
            "black": "#002B36",
            "blue": "#268BD2",
            "brightBlack": "#073642",
            "brightBlue": "#839496",
            "brightCyan": "#93A1A1",
            "brightGreen": "#586E75",
            "brightPurple": "#6C71C4",
            "brightRed": "#CB4B16",
            "brightWhite": "#FDF6E3",
            "brightYellow": "#657B83",
            "cursorColor": "#002B36",
            "cyan": "#2AA198",
            "foreground": "#657B83",
            "green": "#859900",
            "name": "Solarized Light",
            "purple": "#D33682",
            "red": "#DC322F",
            "selectionBackground": "#FFFFFF",
            "white": "#EEE8D5",
            "yellow": "#B58900"
        },
        {
            "background": "#000000",
            "black": "#000000",
            "blue": "#3465A4",
            "brightBlack": "#555753",
            "brightBlue": "#729FCF",
            "brightCyan": "#34E2E2",
            "brightGreen": "#8AE234",
            "brightPurple": "#AD7FA8",
            "brightRed": "#EF2929",
            "brightWhite": "#EEEEEC",
            "brightYellow": "#FCE94F",
            "cursorColor": "#FFFFFF",
            "cyan": "#06989A",
            "foreground": "#D3D7CF",
            "green": "#4E9A06",
            "name": "Tango Dark",
            "purple": "#75507B",
            "red": "#CC0000",
            "selectionBackground": "#FFFFFF",
            "white": "#D3D7CF",
            "yellow": "#C4A000"
        },
        {
            "background": "#FFFFFF",
            "black": "#000000",
            "blue": "#3465A4",
            "brightBlack": "#555753",
            "brightBlue": "#729FCF",
            "brightCyan": "#34E2E2",
            "brightGreen": "#8AE234",
            "brightPurple": "#AD7FA8",
            "brightRed": "#EF2929",
            "brightWhite": "#EEEEEC",
            "brightYellow": "#FCE94F",
            "cursorColor": "#000000",
            "cyan": "#06989A",
            "foreground": "#555753",
            "green": "#4E9A06",
            "name": "Tango Light",
            "purple": "#75507B",
            "red": "#CC0000",
            "selectionBackground": "#FFFFFF",
            "white": "#D3D7CF",
            "yellow": "#C4A000"
        },
        {
            "background": "#300A24",
            "black": "#171421",
            "blue": "#0037DA",
            "brightBlack": "#767676",
            "brightBlue": "#08458F",
            "brightCyan": "#2C9FB3",
            "brightGreen": "#26A269",
            "brightPurple": "#A347BA",
            "brightRed": "#C01C28",
            "brightWhite": "#F2F2F2",
            "brightYellow": "#A2734C",
            "cursorColor": "#FFFFFF",
            "cyan": "#3A96DD",
            "foreground": "#FFFFFF",
            "green": "#26A269",
            "name": "Ubuntu-ColorScheme",
            "purple": "#881798",
            "red": "#C21A23",
            "selectionBackground": "#FFFFFF",
            "white": "#CCCCCC",
            "yellow": "#A2734C"
        },
        {
            "background": "#000000",
            "black": "#000000",
            "blue": "#000080",
            "brightBlack": "#808080",
            "brightBlue": "#0000FF",
            "brightCyan": "#00FFFF",
            "brightGreen": "#00FF00",
            "brightPurple": "#FF00FF",
            "brightRed": "#FF0000",
            "brightWhite": "#FFFFFF",
            "brightYellow": "#FFFF00",
            "cursorColor": "#FFFFFF",
            "cyan": "#008080",
            "foreground": "#C0C0C0",
            "green": "#008000",
            "name": "Vintage",
            "purple": "#800080",
            "red": "#800000",
            "selectionBackground": "#FFFFFF",
            "white": "#C0C0C0",
            "yellow": "#808000"
        },
        {
            "background": "#323232",
            "black": "#323232",
            "blue": "#4099FF",
            "brightBlack": "#535353",
            "brightBlue": "#5EB7F7",
            "brightCyan": "#DCF4FF",
            "brightGreen": "#9DFF91",
            "brightPurple": "#FF9DFF",
            "brightRed": "#F07070",
            "brightWhite": "#FFFFFF",
            "brightYellow": "#FFE48B",
            "cursorColor": "#D6D6D6",
            "cyan": "#BED6FF",
            "foreground": "#FFFFFF",
            "green": "#7FE173",
            "name": "idleToes",
            "purple": "#F680FF",
            "red": "#D25252",
            "selectionBackground": "#5B5B5B",
            "white": "#EEEEEC",
            "yellow": "#FFC66D"
        }
    ],
    "tabSwitcherMode": "mru",
    "tabWidthMode": "equal",
    "theme": "dark",
    "themes": [],
    "trimBlockSelection": true,
    "useAcrylicInTabRow": true,
    "windowingBehavior": "useExisting"
}

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs-Attention The core contributors need to come back around and look at this ASAP. and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels Jun 4, 2024
@SpecterShell
Copy link
Author

SpecterShell commented Jun 4, 2024

1.20.11271.0 has the same issue. Downgrading to 1.19.11213.0 (and delete the states files) fixes the issues.

@carlos-zamora
Copy link
Member

Thanks. Could you take a trace of the issue? It'll help us debug it better.

Here's a guide on how to capture a trace: https://github.com/microsoft/terminal/wiki/Troubleshooting-Tips#capturing-a-debug-etl-trace

Could you also try out v1.21 and see if it repros there /?

@microsoft-github-policy-service microsoft-github-policy-service bot removed the Needs-Attention The core contributors need to come back around and look at this ASAP. label Jun 5, 2024
@carlos-zamora carlos-zamora added Product-Terminal The new Windows Terminal. Area-Remoting Communication layer between windows. Often for windowing behavior, quake mode, etc. and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Attention The core contributors need to come back around and look at this ASAP. labels Jun 5, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Jun 5, 2024
@carlos-zamora carlos-zamora added this to the Terminal v1.22 milestone Jun 5, 2024
@SpecterShell
Copy link
Author

terminal-trace.zip

Can also reproduce in v1.21

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs-Attention The core contributors need to come back around and look at this ASAP. and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels Jun 6, 2024
@michaelarnauts
Copy link

I think I see the same issue, but Quake Mode doesn't work here after closing.

When I close the last tab in Quake Mode, I can't use the shortcut to open it again, and I have to kill Windows Terminal to be able to use it again.

@SpecterShell
Copy link
Author

I think I find the reason. Today I cleared all the contents of the settings file (so WT would generate a new one on the next startup) and set the "New instance behavior" to "Attach to most recently used window on this desktop". This time everything works like a charm.

So there might be something wrong with the config, then I found it was

"compatibility.allowHeadless": true,

that caused the issue.

@michaelarnauts
Copy link

I think I find the reason. Today I cleared all the contents of the settings file (so WT would generate a new one on the next startup) and set the "New instance behavior" to "Attach to most recently used window on this desktop". This time everything works like a charm.

So there might be something wrong with the config, then I found it was

"compatibility.allowHeadless": true,

that caused the issue.

Awesome. I've removed this option, and now I can indeed re-open Terminal after closing the last tab in a quake window.

Looking at the description of that option (https://learn.microsoft.com/en-us/windows/terminal/customize-settings/startup#continue-running-in-the-background-preview):

When set to true, this enables the terminal to continue running in the background after the last window is closed. This allows globalSummon and quake mode to work even when no windows are open. This setting is only available in Preview builds of the Terminal.

It seems that this simply doesn't work correctly. since the global-summon and quake mode doesn't work, but it indeed stays running.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Remoting Communication layer between windows. Often for windowing behavior, quake mode, etc. In-PR This issue has a related PR Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Attention The core contributors need to come back around and look at this ASAP. Needs-Tag-Fix Doesn't match tag requirements Product-Terminal The new Windows Terminal.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants