Closing tab hangs when using VS Dev tools and Powershell Core #18507

Closed
opened 2026-01-31 06:16:11 +00:00 by claunia · 7 comments
Owner

Originally created by @phil-scott-78 on GitHub (Sep 19, 2022).

Originally assigned to: @lhecker on GitHub.

Windows Terminal version

1.16.2524.0

Windows build number

10.0.25201.0

Other Software

  • Visual Studio 2022
  • Powershell Core 7.2.6

Steps to reproduce

  1. Create a profile using pwsh.exe in Windows Terminal Preview
  2. Execute the following lines to add the VS dev tools
Import-Module "C:\Program Files\Microsoft Visual Studio\2022\Preview\Common7\Tools\Microsoft.VisualStudio.DevShell.dll"
Enter-VsDevShell 8ee891c5 -SkipAutomaticLocation -DevCmdArguments "-arch=x64 -host_arch=x64"
  1. Close the tab

Expected Behavior

Tab closes quickly.

Actual Behavior

wt locks up entirely doing...something.

Animation

I've tested this with the release version of Windows Terminal and also regular powershell.exe. Both of those don't exhibit the behavior. It is only with Powershell Core, the most recent release of wt.exe and the Visual Studio dev tools

Originally created by @phil-scott-78 on GitHub (Sep 19, 2022). Originally assigned to: @lhecker on GitHub. ### Windows Terminal version 1.16.2524.0 ### Windows build number 10.0.25201.0 ### Other Software * Visual Studio 2022 * Powershell Core 7.2.6 ### Steps to reproduce 1. Create a profile using `pwsh.exe` in Windows Terminal Preview 2. Execute the following lines to add the VS dev tools ```powershell Import-Module "C:\Program Files\Microsoft Visual Studio\2022\Preview\Common7\Tools\Microsoft.VisualStudio.DevShell.dll" Enter-VsDevShell 8ee891c5 -SkipAutomaticLocation -DevCmdArguments "-arch=x64 -host_arch=x64" ``` 3. Close the tab ### Expected Behavior Tab closes quickly. ### Actual Behavior wt locks up entirely doing...something. ![Animation](https://user-images.githubusercontent.com/2447331/190947485-bf79b9ca-82a6-4de5-bb15-7987e7b4dc3d.gif) I've tested this with the release version of Windows Terminal and also regular powershell.exe. Both of those don't exhibit the behavior. It is only with Powershell Core, the most recent release of wt.exe and the Visual Studio dev tools
Author
Owner

@DHowett commented on GitHub (Sep 19, 2022):

Ah, this could (possibly?) be fallout from #13882. /cc @lhecker for when he's got time.
Thanks for the report!

@DHowett commented on GitHub (Sep 19, 2022): Ah, this could (possibly?) be fallout from #13882. /cc @lhecker for when he's got time. Thanks for the report!
Author
Owner

@phil-scott-78 commented on GitHub (Sep 19, 2022):

I suspect you are right, I did a few heap dumps to see if I could spot anything of note and I noticed they were both hung on the same line related to the conpty connect, specifically this line https://github.com/microsoft/terminal/blob/main/src/cascadia/TerminalConnection/ConptyConnection.cpp#L557

@phil-scott-78 commented on GitHub (Sep 19, 2022): I suspect you are right, I did a few heap dumps to see if I could spot anything of note and I noticed they were both hung on the same line related to the conpty connect, specifically this line https://github.com/microsoft/terminal/blob/main/src/cascadia/TerminalConnection/ConptyConnection.cpp#L557
Author
Owner

@lhecker commented on GitHub (Sep 19, 2022):

I debugged this just now and and it's actually hung somewhere else for me:
(It's hung in WaitForSingleObject(pPty->hConPtyProcess, INFINITE);)

image

@lhecker commented on GitHub (Sep 19, 2022): I debugged this just now and and it's actually hung somewhere else for me: (It's hung in `WaitForSingleObject(pPty->hConPtyProcess, INFINITE);`) ![image](https://user-images.githubusercontent.com/2256941/191125460-f1f9cf53-ab4d-4845-9959-942837b134d4.png)
Author
Owner

@lhecker commented on GitHub (Sep 19, 2022):

Ah right... The old version used to close the connection in the background only, so it didn't matter how long it took and it wasn't visually apparent either: 666c446bc3 (diff-baa2e4fc26af1b8722a4eec13221622ef4ae566e4f7a8658bc58806f96b7e9b8L1525-L1526)
But as mentioned in the PR, that's not viable at all, because that's a pretty nasty race condition.

@lhecker commented on GitHub (Sep 19, 2022): Ah right... The old version used to close the connection in the background only, so it didn't matter how long it took and it wasn't visually apparent either: https://github.com/microsoft/terminal/commit/666c446bc38f741a7fc17b481ea1c665a4f31d13#diff-baa2e4fc26af1b8722a4eec13221622ef4ae566e4f7a8658bc58806f96b7e9b8L1525-L1526 But as mentioned in the PR, that's not viable at all, because that's a pretty nasty race condition.
Author
Owner

@phil-scott-78 commented on GitHub (Sep 20, 2022):

@lhecker, I just double checked - I'm hung on the same line. The one I posted earlier was down further in the stack.

@phil-scott-78 commented on GitHub (Sep 20, 2022): @lhecker, I just double checked - I'm hung on the same line. The one I posted earlier was down further in the stack.
Author
Owner

@ghost commented on GitHub (Sep 23, 2022):

:tada:This issue was addressed in #14041, which has now been successfully released as Windows Terminal Preview v1.16.2641.0.🎉

Handy links:

@ghost commented on GitHub (Sep 23, 2022): :tada:This issue was addressed in #14041, which has now been successfully released as `Windows Terminal Preview v1.16.2641.0`.:tada: Handy links: * [Release Notes](https://github.com/microsoft/terminal/releases/tag/v1.16.2641.0) * [Store Download](https://www.microsoft.com/store/apps/9n8g5rfz9xk3?cid=storebadge&ocid=badge)
Author
Owner

@ghost commented on GitHub (Oct 18, 2022):

:tada:This issue was addressed in #14041, which has now been successfully released as Windows Terminal v1.15.2874.🎉

Handy links:

@ghost commented on GitHub (Oct 18, 2022): :tada:This issue was addressed in #14041, which has now been successfully released as `Windows Terminal v1.15.2874`.:tada: Handy links: * [Release Notes](https://github.com/microsoft/terminal/releases/tag/v1.15.2874) * [Store Download](https://www.microsoft.com/store/apps/9n8g5rfz9xk3?cid=storebadge&ocid=badge)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#18507