Tracked in VSCode as https://github.com/microsoft/vscode/issues/50308.
(On Windows)
code .exit PowerShellcode but does not open a new window (because one for the directory is already open) the issue does not occur
Name Value
---- -----
PSVersion 7.0.0-rc.1
PSEdition Core
GitCommitId 7.0.0-rc.1
OS Microsoft Windows 10.0.19535
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0鈥
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
This is microsoft/vscode#66750.
PowerShell try to detect that application is GUI then run it async. Otherwise it run the application as console application in sync.
See #9970 for reference on IsWindowsApplication()
There's nothing PowerShell can do to prevent this. VSCode (<=1.41? to be confirmed) _re-attaches to the console handle it receives from its parent_. In so doing, it prevents the console from being closed when PowerShell exits because there's still one application attached to it.
This issue has been marked as external and has not had any activity for 1 day. It has been be closed for housekeeping purposes.
Most helpful comment
There's nothing PowerShell can do to prevent this. VSCode (<=1.41? to be confirmed) _re-attaches to the console handle it receives from its parent_. In so doing, it prevents the console from being closed when PowerShell exits because there's still one application attached to it.