<h1 dir="auto">Environment</h1>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Windows build number: Microsoft Windows [Version 10.0.18362.175]

Any other software? Visual Studio Code Insiders"><pre lang="none" class="notranslate"><code class="notranslate">Windows build number: Microsoft Windows [Version 10.0.18362.175]

Any other software? Visual Studio Code Insiders
</code></pre></div>
<h1 dir="auto">Steps to reproduce</h1>

<ol dir="auto">
<li>Launch VS Code Insiders.</li>
<li>Ensure using conpty with setting: <code class="notranslate">terminal.integrated.windowsEnableConpty</code></li>
<li>Open a terminal with Ctrl+`</li>
<li>Close the terminal with the trash can icon</li>
<li>Repeat 3 and 4 until the window hangs. It takes around 10 retries on my machine.</li>
</ol>
<h1 dir="auto">Expected behavior</h1>
<p dir="auto">No hanging.</p>
<h1 dir="auto">Actual behavior</h1>
<p dir="auto">The window hangs. Using windbg, I see the following:</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/6561887/60627570-4dae2800-9da3-11e9-9ff4-9aefa9ed5b01.png"><img src="https://user-images.githubusercontent.com/6561887/60627570-4dae2800-9da3-11e9-9ff4-9aefa9ed5b01.png" alt="conpty_stack" style="max-width: 100%;"></a><br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/6561887/60627571-4dae2800-9da3-11e9-9768-0adfc21f1453.png"><img src="https://user-images.githubusercontent.com/6561887/60627571-4dae2800-9da3-11e9-9768-0adfc21f1453.png" alt="conpty_locals" style="max-width: 100%;"></a><br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/6561887/60627572-4dae2800-9da3-11e9-91fd-4279f1d9137d.png"><img src="https://user-images.githubusercontent.com/6561887/60627572-4dae2800-9da3-11e9-91fd-4279f1d9137d.png" alt="conpty_leftovers" style="max-width: 100%;"></a></p>
<p dir="auto">Notice the many leftover conhosts in the task manager as well as the hang in ClosePseudoConsole.</p>
<p dir="auto">Here is the link to the code in node-pty calling into the PseudoConsole API.<br>
<a href="https://github.com/microsoft/node-pty/blob/04445ed76f90b4f56a190982ea2d4fcdd22a0ee7/src/win/conpty.cc#L429">https://github.com/microsoft/node-pty/blob/04445ed76f90b4f56a190982ea2d4fcdd22a0ee7/src/win/conpty.cc#L429</a></p>
<p dir="auto">/cc @daimms</p>
<h1 dir="auto">Environment</h1>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Windows build number: Microsoft Windows [Version 10.0.18362.10000]
Windows Terminal version (if applicable): EARLY PREVIEW BUILD

Any other software?"><pre lang="none" class="notranslate"><code class="notranslate">Windows build number: Microsoft Windows [Version 10.0.18362.10000]
Windows Terminal version (if applicable): EARLY PREVIEW BUILD

Any other software?
</code></pre></div>
<h1 dir="auto">Steps to reproduce</h1>

<p dir="auto">Open multiple tabs in the terminal</p>
<h1 dir="auto">Expected behavior</h1>
<p dir="auto">The tabs resize in that way we can see all the tabs o close one</p>

<h1 dir="auto">Actual behavior</h1>

<p dir="auto">Many tabs open without been possible closed</p>