Windows Vim crashes terminal when I close the tab #2625

Closed
opened 2026-01-30 23:00:29 +00:00 by claunia · 7 comments
Owner

Originally created by @0x00000FF on GitHub (Jul 8, 2019).

Environment

Windows build number: Microsoft Windows [Version 10.0.18932.1000]
Windows Terminal version (if applicable): 0.2.1831.0

Any other software?
VIM - Vi IMproved 8.1 (2018 May 18, compiled May 18 2018 18:26:56), 32bit Console version, [Korean]

Steps to reproduce

Start windows terminal with PowerShell 6.2.0 and runs Vim with vim.
PATH for vim was C:\Program Files (x86)\Vim\vim81.
Close tab with vim is running.

Expected behavior

Tab must be closed. If the tab was only one, terminal must be terminated.

Actual behavior

Entire terminal is crashed.

Originally created by @0x00000FF on GitHub (Jul 8, 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: Microsoft Windows [Version 10.0.18932.1000] Windows Terminal version (if applicable): 0.2.1831.0 Any other software? VIM - Vi IMproved 8.1 (2018 May 18, compiled May 18 2018 18:26:56), 32bit Console version, [Korean] ``` # Steps to reproduce Start windows terminal with PowerShell 6.2.0 and runs Vim with `vim`. `PATH` for vim was `C:\Program Files (x86)\Vim\vim81`. Close tab with vim is running. <!-- A description of how to trigger this bug. --> # Expected behavior Tab must be closed. If the tab was only one, terminal must be terminated. <!-- A description of what you're expecting, possibly containing screenshots or reference material. --> # Actual behavior Entire terminal is crashed. <!-- What's actually happening? -->
claunia added the Resolution-DuplicateSeverity-Crash labels 2026-01-30 23:00:29 +00:00
Author
Owner

@TayYuanGeng commented on GitHub (Jul 8, 2019):

Correct me if I am wrong, Windows Vim is your last tab and you're attempting to close the terminal through the tab?

@TayYuanGeng commented on GitHub (Jul 8, 2019): Correct me if I am wrong, Windows Vim is your last tab and you're attempting to close the terminal through the tab?
Author
Owner

@0x00000FF commented on GitHub (Jul 8, 2019):

Whether the tab is the last or not, Terminal always crashed when I close a tab which is running Windows Vim

@0x00000FF commented on GitHub (Jul 8, 2019): Whether the tab is the last or not, Terminal always crashed when I close a tab which is running Windows Vim
Author
Owner

@TayYuanGeng commented on GitHub (Jul 8, 2019):

Seems like a similar issue to #36

@TayYuanGeng commented on GitHub (Jul 8, 2019): Seems like a similar issue to #36
Author
Owner

@0x00000FF commented on GitHub (Jul 8, 2019):

I don't think so, because there's no cpu or memory fluctuation, terminal just stays without any responses.

I've tested with sample application which changes console title to "한국어", "にほんご", "漢字" and even same title with my vim "[제목없음] - VIM2", It seems that unicode characters are not the reason of terminal crash.

@0x00000FF commented on GitHub (Jul 8, 2019): I don't think so, because there's no cpu or memory fluctuation, terminal just stays without any responses. I've tested with sample application which changes console title to "한국어", "にほんご", "漢字" and even same title with my vim "[제목없음] - VIM2", It seems that unicode characters are not the reason of terminal crash.
Author
Owner

@RichardSlater commented on GitHub (Jul 8, 2019):

Confirmed this as happening on Dev Build compiled from source with master at commit 7eae91:

Windows:     10.0.18362.0
PowerShell:  5.1.18362.145
VIM - Vi IMproved 8.1 (2018 May 18, compiled May 18 2018 18:26:56)

Attached profiler showed no change in memory consumption and CPU dropped to 0% from either ConHost.exe or WindowsTerminal, event viewer reports:

 Process ID: 3724
 Start Time: 01d53576439f9dd6
 Termination Time: 7
 Application Path: C:\source\richardslater\terminal\src\cascadia\CascadiaPackage\bin\x64\Release\AppX\WindowsTerminal.exe
 Report Id: f8bc8e57-e771-400e-b1e0-c9634c1baab9
 Faulting package full name: WindowsTerminalDev_0.0.1.0_x64__8wekyb3d8bbwe
 Faulting package-relative application ID: App
 Hang type: Cross-process

Only occurs in PowerShell and CMD, not in WSL Bash (Ubuntu) and seems to occur regardless of whether the tab is the last tab, first tab, middle tab, etc.

Possibly unrelated but, when attaching a debugger to the ConHost.exe that Vim is executing under, ConHost seems to be stuck in the for loop in terminal\src\renderer\base\renderer.cpp:252:

void Renderer::TriggerTeardown()
{
    // We need to shut down the paint thread on teardown.
    _pThread->WaitForPaintCompletionAndDisable(INFINITE);

    // Then walk through and do one final paint on the caller's thread.
    for (IRenderEngine* const pEngine : _rgpEngines)
    {
        bool fEngineRequestsRepaint = false;
        HRESULT hr = pEngine->PrepareForTeardown(&fEngineRequestsRepaint);
        LOG_IF_FAILED(hr);

        if (SUCCEEDED(hr) && fEngineRequestsRepaint)
        {
            LOG_IF_FAILED(_PaintFrameForEngine(pEngine));
        }
    }
}
@RichardSlater commented on GitHub (Jul 8, 2019): Confirmed this as happening on Dev Build compiled from source with master at commit 7eae91: ``` Windows: 10.0.18362.0 PowerShell: 5.1.18362.145 VIM - Vi IMproved 8.1 (2018 May 18, compiled May 18 2018 18:26:56) ``` Attached profiler showed no change in memory consumption and CPU dropped to 0% from either ConHost.exe or WindowsTerminal, event viewer reports: ```The program WindowsTerminal.exe version 0.0.0.0 stopped interacting with Windows and was closed. To see if more information about the problem is available, check the problem history in the Security and Maintenance control panel. Process ID: 3724 Start Time: 01d53576439f9dd6 Termination Time: 7 Application Path: C:\source\richardslater\terminal\src\cascadia\CascadiaPackage\bin\x64\Release\AppX\WindowsTerminal.exe Report Id: f8bc8e57-e771-400e-b1e0-c9634c1baab9 Faulting package full name: WindowsTerminalDev_0.0.1.0_x64__8wekyb3d8bbwe Faulting package-relative application ID: App Hang type: Cross-process ``` Only occurs in PowerShell and CMD, not in WSL Bash (Ubuntu) and seems to occur regardless of whether the tab is the last tab, first tab, middle tab, etc. Possibly unrelated but, when attaching a debugger to the ConHost.exe that Vim is executing under, ConHost seems to be stuck in the for loop in `terminal\src\renderer\base\renderer.cpp:252`: ``` void Renderer::TriggerTeardown() { // We need to shut down the paint thread on teardown. _pThread->WaitForPaintCompletionAndDisable(INFINITE); // Then walk through and do one final paint on the caller's thread. for (IRenderEngine* const pEngine : _rgpEngines) { bool fEngineRequestsRepaint = false; HRESULT hr = pEngine->PrepareForTeardown(&fEngineRequestsRepaint); LOG_IF_FAILED(hr); if (SUCCEEDED(hr) && fEngineRequestsRepaint) { LOG_IF_FAILED(_PaintFrameForEngine(pEngine)); } } } ```
Author
Owner

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

IIRC this crash is #1380, but @DHowett-MSFT can correct me if I'm wrong. It seems like it's still happening even after the fix from that issue.

@zadjii-msft commented on GitHub (Jul 8, 2019): IIRC this crash is #1380, but @DHowett-MSFT can correct me if I'm wrong. It seems like it's still happening even after the fix from that issue.
Author
Owner

@DHowett-MSFT commented on GitHub (Jul 8, 2019):

This is almost certainly #1380 (we love this bug, we just keep bringing it back)

@DHowett-MSFT commented on GitHub (Jul 8, 2019): This is almost certainly #1380 (we love this bug, we just keep bringing it back)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#2625