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

Temporary integrated consoles stuck waiting for key press #3950

Closed
5 of 6 tasks
ohaak2 opened this issue May 4, 2022 · 12 comments · Fixed by PowerShell/PowerShellEditorServices#1791 or #3951
Closed
5 of 6 tasks
Assignees
Labels

Comments

@ohaak2
Copy link

ohaak2 commented May 4, 2022

Prerequisites

  • I have written a descriptive issue title.
  • I have searched all issues to ensure it has not already been reported.
  • I have read the troubleshooting guide.
  • I am sure this issue is with the extension itself and does not reproduce in a standalone PowerShell instance.
  • I have verified that I am using the latest version of Visual Studio Code and the PowerShell extension.
  • If this is a security issue, I have read the security issue reporting guidance.

Summary

With vscode version 1.66.2 and PowerShell extension v2022.5.0 I'm suddenly unable to start any PowerShell session, if the powershell.debugging.createTemporaryIntegratedConsole parameter is set to 'true'.

PowerShell session isn't even started in run mode. It's just hanging somewhere before actually processing any custom code. No code will be executed, no breakpoint reached. I can reproduce the isse even with a single file containing 'hello world' output.

Switching this setting to 'false' and everything is fine.

PowerShell Version

> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      7.2.3
PSEdition                      Core
GitCommitId                    7.2.3
OS                             Microsoft Windows 10.0.22000
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Visual Studio Code Version

PS > code --version

1.66.2
dfd34e8260c270da74b5c2d86d61aee4b6d56977
x64

Extension Version

PS > code --list-extensions --show-versions | Select-String powershell

ms-vscode.powershell@2022.5.0

Steps to Reproduce

  • Open PowerShell file in vscode.
  • set powershell.debugging.createTemporaryIntegratedConsole configuration parameter to 'true'
  • try to start run or debug session.

Visuals

No response

Logs

DEBUG: Logging started
DEBUG: Beginning EndProcessing block
VERBOSE: Removing PSReadLine
DEBUG: Creating host configuration
DEBUG: Determining REPL kind
DEBUG: REPL configured as PSReadLine
DEBUG: Configuring LSP transport
DEBUG: No LSP transport: PSES is debug only
DEBUG: Configuring debug transport
DEBUG: Session file writer created
VERBOSE: Adding AssemblyResolve event handler for new AssemblyLoadContext dependency loading
VERBOSE: Loading EditorServices
VERBOSE: PID: 9424
VERBOSE:
== Build Details ==

  • Editor Services version: 3.3.4
  • Build origin: Release
  • Build commit: 691b941e113d7aa1e3876b1e1da301098f8df392
  • Build time: 03.05.2022 00:00:00

VERBOSE:
== Host Startup Configuration Details ==

  • Host name: Visual Studio Code Host

  • Host version: 2022.5.0

  • Host profile ID: Microsoft.VSCode

  • PowerShell host type: System.Management.Automation.Internal.Host.InternalHost

  • REPL setting: PSReadLine

  • Session details path: c:\Users\rueha.vscode\extensions\ms-vscode.powershell-2022.5.0\sessions\PSES-VSCode-6644-Debug

  • Bundled modules path: c:\Users\rueha.vscode\extensions\ms-vscode.powershell-2022.5.0\modules

  • Additional modules: PowerShellEditorServices.VSCode

  • Feature flags:

  • Log path: c:\Users\rueha.vscode\extensions\ms-vscode.powershell-2022.5.0\logs\1651659916-33522e08-f534-442f-90f9-4f15d444b3e31651659351331\DebugSession-4.log

  • Minimum log level: Diagnostic

  • Profile paths:

    • AllUsersAllHosts: C:\Program Files\WindowsApps\Microsoft.PowerShell_7.2.3.0_x64__8wekyb3d8bbwe\profile.ps1
    • AllUsersCurrentHost: C:\Program Files\WindowsApps\Microsoft.PowerShell_7.2.3.0_x64__8wekyb3d8bbwe\Microsoft.VSCode_profile.ps1
    • CurrentUserAllHosts: C:\Users\rueha\Documents\PowerShell\profile.ps1
    • CurrentUserCurrentHost: C:\Users\rueha\Documents\PowerShell\Microsoft.VSCode_profile.ps1

DEBUG: Assembly resolve event fired for System.Text.Encoding.CodePages.resources, Version=6.0.0.0, Culture=de-DE, PublicKeyToken=b03f5f7f11d50a3a
DEBUG: Assembly resolve event fired for System.Text.Encoding.CodePages.resources, Version=6.0.0.0, Culture=de, PublicKeyToken=b03f5f7f11d50a3a
DEBUG: Loaded into load context "Default" System.Runtime.Loader.DefaultAssemblyLoadContext #0: Microsoft.PowerShell.Commands.Diagnostics, Version=7.2.3.500, Culture=neutral, PublicKeyToken=31bf3856ad364e35
DEBUG: Loaded into load context "Default" System.Runtime.Loader.DefaultAssemblyLoadContext #0: Microsoft.WSMan.Management, Version=7.2.3.500, Culture=neutral, PublicKeyToken=31bf3856ad364e35
DEBUG: Loaded into load context "Default" System.Runtime.Loader.DefaultAssemblyLoadContext #0: Microsoft.WSMan.Runtime, Version=7.2.3.500, Culture=neutral, PublicKeyToken=31bf3856ad364e35
DEBUG: Assembly resolve event fired for Microsoft.PowerShell.Security.resources, Version=7.2.3.500, Culture=de-DE, PublicKeyToken=31bf3856ad364e35
DEBUG: Assembly resolve event fired for Microsoft.PowerShell.Security.resources, Version=7.2.3.500, Culture=de, PublicKeyToken=31bf3856ad364e35
DEBUG: Assembly resolve event fired for Microsoft.WSMan.Management.resources, Version=7.2.3.500, Culture=de-DE, PublicKeyToken=31bf3856ad364e35
DEBUG: Assembly resolve event fired for Microsoft.WSMan.Management.resources, Version=7.2.3.500, Culture=de, PublicKeyToken=31bf3856ad364e35
VERBOSE:
== Console Details ==

  • Console input encoding: Western European (DOS)
  • Console output encoding: Western European (DOS)
  • PowerShell output encoding: Unicode (UTF-8)

VERBOSE:
== PowerShell Details ==

  • PowerShell version: 7.2.3
  • Language mode: FullLanguage

VERBOSE:
== Environment Details ==

  • OS description: Microsoft Windows 10.0.22000
  • OS architecture: X64
  • Process bitness: 64

VERBOSE: Updated PSModulePath to: 'C:\Users\rueha\Documents\PowerShell\Modules;C:\Program Files\PowerShell\Modules;c:\program files\windowsapps\microsoft.powershell_7.2.3.0_x64__8wekyb3d8bbwe\Modules;C:\Program Files\WindowsPowerShell\Modules;C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules;c:\Users\rueha.vscode\extensions\ms-vscode.powershell-2022.5.0\modules'
DEBUG: Validating configuration
VERBOSE: Loading PowerShell Editor Services
DEBUG: Assembly resolve event fired for Microsoft.PowerShell.EditorServices, Version=3.3.4.0, Culture=neutral, PublicKeyToken=null
VERBOSE: Loading PSES DLL using new assembly load context
DEBUG: Loaded into load context "PsesLoadContext" Microsoft.PowerShell.EditorServices.Hosting.PsesLoadContext #1: Microsoft.PowerShell.EditorServices, Version=3.3.4.0, Culture=neutral, PublicKeyToken=null
VERBOSE: Starting EditorServices
DEBUG: Loaded into load context "PsesLoadContext" Microsoft.PowerShell.EditorServices.Hosting.PsesLoadContext #1: Microsoft.Extensions.Logging, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60
DEBUG: Loaded into load context "PsesLoadContext" Microsoft.PowerShell.EditorServices.Hosting.PsesLoadContext #1: Microsoft.Extensions.Logging.Abstractions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60
DEBUG: Loaded into load context "PsesLoadContext" Microsoft.PowerShell.EditorServices.Hosting.PsesLoadContext #1: Serilog, Version=2.0.0.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10
DEBUG: Loaded into load context "PsesLoadContext" Microsoft.PowerShell.EditorServices.Hosting.PsesLoadContext #1: Serilog.Sinks.Async, Version=1.5.0.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10
DEBUG: Loaded into load context "PsesLoadContext" Microsoft.PowerShell.EditorServices.Hosting.PsesLoadContext #1: Serilog.Extensions.Logging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10
DEBUG: Loaded into load context "PsesLoadContext" Microsoft.PowerShell.EditorServices.Hosting.PsesLoadContext #1: Serilog.Sinks.File, Version=5.0.0.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10
DEBUG: Loaded into load context "PsesLoadContext" Microsoft.PowerShell.EditorServices.Hosting.PsesLoadContext #1: Microsoft.Extensions.Options, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60
DEBUG: Creating/running editor services
DEBUG: Creating startup info object
DEBUG: Running temp debug session
DEBUG: Creating named pipe
DEBUG: Waiting for named pipe connection
DEBUG: Writing session file
DEBUG: Writing session started
VERBOSE: Session file written to c:\Users\rueha.vscode\extensions\ms-vscode.powershell-2022.5.0\sessions\PSES-VSCode-6644-Debug with content:
{"status":"started","debugServiceTransport":"NamedPipe","debugServicePipeName":"\\.\pipe\PSES_gwa1rshq.nux"}
DEBUG: Waiting on PSES run/shutdown
DEBUG: Named pipe connected
DEBUG: Loaded into load context "PsesLoadContext" Microsoft.PowerShell.EditorServices.Hosting.PsesLoadContext #1: Microsoft.Extensions.DependencyInjection, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60
DEBUG: Loaded into load context "PsesLoadContext" Microsoft.PowerShell.EditorServices.Hosting.PsesLoadContext #1: Microsoft.Bcl.AsyncInterfaces, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
DEBUG: Loaded into load context "Default" System.Runtime.Loader.DefaultAssemblyLoadContext #0: System.Threading.Tasks.Extensions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
DEBUG: Loaded into load context "PsesLoadContext" Microsoft.PowerShell.EditorServices.Hosting.PsesLoadContext #1: Microsoft.Extensions.DependencyInjection.Abstractions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60
DEBUG: Loaded into load context "PsesLoadContext" Microsoft.PowerShell.EditorServices.Hosting.PsesLoadContext #1: OmniSharp.Extensions.LanguageProtocol, Version=0.19.0.0, Culture=neutral, PublicKeyToken=6d868dff454e6022
DEBUG: Loaded into load context "PsesLoadContext" Microsoft.PowerShell.EditorServices.Hosting.PsesLoadContext #1: OmniSharp.Extensions.JsonRpc, Version=0.19.0.0, Culture=neutral, PublicKeyToken=6d868dff454e6022
DEBUG: Loaded into load context "Default" System.Runtime.Loader.DefaultAssemblyLoadContext #0: System.Buffers, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
VERBOSE: Debug server created
DEBUG: Loaded into load context "PsesLoadContext" Microsoft.PowerShell.EditorServices.Hosting.PsesLoadContext #1: OmniSharp.Extensions.DebugAdapter.Server, Version=0.19.0.0, Culture=neutral, PublicKeyToken=6d868dff454e6022
DEBUG: Loaded into load context "PsesLoadContext" Microsoft.PowerShell.EditorServices.Hosting.PsesLoadContext #1: MediatR, Version=8.0.0.0, Culture=neutral, PublicKeyToken=bb9a41a5e8aaa7e2
DEBUG: Loaded into load context "PsesLoadContext" Microsoft.PowerShell.EditorServices.Hosting.PsesLoadContext #1: OmniSharp.Extensions.DebugAdapter, Version=0.19.0.0, Culture=neutral, PublicKeyToken=6d868dff454e6022
DEBUG: Loaded into load context "PsesLoadContext" Microsoft.PowerShell.EditorServices.Hosting.PsesLoadContext #1: OmniSharp.Extensions.DebugAdapter.Shared, Version=0.19.0.0, Culture=neutral, PublicKeyToken=6d868dff454e6022
DEBUG: Loaded into load context "PsesLoadContext" Microsoft.PowerShell.EditorServices.Hosting.PsesLoadContext #1: Microsoft.Extensions.Configuration.Abstractions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60
DEBUG: Loaded into load context "PsesLoadContext" Microsoft.PowerShell.EditorServices.Hosting.PsesLoadContext #1: System.Reactive, Version=4.4.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263
DEBUG: Loaded into load context "PsesLoadContext" Microsoft.PowerShell.EditorServices.Hosting.PsesLoadContext #1: Nerdbank.Streams, Version=2.6.0.0, Culture=neutral, PublicKeyToken=cac503e1823ce71c
DEBUG: Loaded into load context "PsesLoadContext" Microsoft.PowerShell.EditorServices.Hosting.PsesLoadContext #1: System.IO.Pipelines, Version=4.0.2.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
DEBUG: Loaded into load context "PsesLoadContext" Microsoft.PowerShell.EditorServices.Hosting.PsesLoadContext #1: Microsoft.VisualStudio.Validation, Version=15.3.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
DEBUG: Loaded into load context "PsesLoadContext" Microsoft.PowerShell.EditorServices.Hosting.PsesLoadContext #1: Microsoft.VisualStudio.Threading, Version=16.7.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
DEBUG: Loaded into load context "Default" System.Runtime.Loader.DefaultAssemblyLoadContext #0: System.Diagnostics.StackTrace, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
DEBUG: Loaded into load context "Default" System.Runtime.Loader.DefaultAssemblyLoadContext #0: System.Collections.Immutable, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
DEBUG: Loaded into load context "PsesLoadContext" Microsoft.PowerShell.EditorServices.Hosting.PsesLoadContext #1: Microsoft.Extensions.Primitives, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60
DEBUG: Loaded into load context "Default" System.Runtime.Loader.DefaultAssemblyLoadContext #0: System.Threading.Channels, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
DEBUG: Loaded into load context "Default" System.Runtime.Loader.DefaultAssemblyLoadContext #0: Microsoft.PowerShell.PSReadLine2, Version=2.2.5.0, Culture=neutral, PublicKeyToken=null
DEBUG: Loaded into load context "Default" System.Runtime.Loader.DefaultAssemblyLoadContext #0: mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
DEBUG: Loaded into load context "Default" System.Runtime.Loader.DefaultAssemblyLoadContext #0: System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
DEBUG: Loaded into load context "Default" System.Runtime.Loader.DefaultAssemblyLoadContext #0: System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
DEBUG: Assembly resolve event fired for Microsoft.PowerShell.PSReadLine.Polyfiller, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
DEBUG: Loaded into load context "Default" System.Runtime.Loader.DefaultAssemblyLoadContext #0: Microsoft.PowerShell.PSReadLine.Polyfiller, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
DEBUG: Assembly resolve event fired for System.Management.Automation.resources, Version=7.2.3.500, Culture=de-DE, PublicKeyToken=31bf3856ad364e35
DEBUG: Assembly resolve event fired for System.Management.Automation.resources, Version=7.2.3.500, Culture=de, PublicKeyToken=31bf3856ad364e35
DEBUG: Assembly resolve event fired for System.Management.Automation.resources, Version=7.2.3.500, Culture=de-DE, PublicKeyToken=31bf3856ad364e35
DEBUG: Assembly resolve event fired for System.Management.Automation.resources, Version=7.2.3.500, Culture=de, PublicKeyToken=31bf3856ad364e35
DEBUG: Assembly resolve event fired for Microsoft.PowerShell.Commands.Utility.resources, Version=7.2.3.500, Culture=de-DE, PublicKeyToken=31bf3856ad364e35
DEBUG: Assembly resolve event fired for Microsoft.PowerShell.Commands.Utility.resources, Version=7.2.3.500, Culture=de, PublicKeyToken=31bf3856ad364e35
DEBUG: Assembly resolve event fired for System.Management.Automation.resources, Version=7.2.3.500, Culture=de-DE, PublicKeyToken=31bf3856ad364e35
DEBUG: Assembly resolve event fired for System.Management.Automation.resources, Version=7.2.3.500, Culture=de, PublicKeyToken=31bf3856ad364e35
DEBUG: Assembly resolve event fired for Microsoft.PowerShell.Commands.Utility.resources, Version=7.2.3.500, Culture=de-DE, PublicKeyToken=31bf3856ad364e35
DEBUG: Assembly resolve event fired for Microsoft.PowerShell.Commands.Utility.resources, Version=7.2.3.500, Culture=de, PublicKeyToken=31bf3856ad364e35
DEBUG: Assembly resolve event fired for Microsoft.PowerShell.EditorServices, Culture=neutral, PublicKeyToken=null
VERBOSE: Loading PSES DLL using new assembly load context
DEBUG: Assembly resolve event fired for Microsoft.PowerShell.EditorServices, Culture=neutral, PublicKeyToken=null
VERBOSE: Loading PSES DLL using new assembly load context
DEBUG: Assembly resolve event fired for Microsoft.PowerShell.EditorServices, Culture=neutral, PublicKeyToken=null
VERBOSE: Loading PSES DLL using new assembly load context
DEBUG: Assembly resolve event fired for Microsoft.PowerShell.EditorServices, Culture=neutral, PublicKeyToken=null
VERBOSE: Loading PSES DLL using new assembly load context
DEBUG: Assembly resolve event fired for Microsoft.PowerShell.EditorServices, Culture=neutral, PublicKeyToken=null
VERBOSE: Loading PSES DLL using new assembly load context
DEBUG: Assembly resolve event fired for Microsoft.PowerShell.EditorServices, Culture=neutral, PublicKeyToken=null
VERBOSE: Loading PSES DLL using new assembly load context
DEBUG: Assembly resolve event fired for Microsoft.PowerShell.EditorServices, Culture=neutral, PublicKeyToken=null
VERBOSE: Loading PSES DLL using new assembly load context
DEBUG: Assembly resolve event fired for System.Management.Automation.resources, Version=7.2.3.500, Culture=de-DE, PublicKeyToken=31bf3856ad364e35
DEBUG: Assembly resolve event fired for System.Management.Automation.resources, Version=7.2.3.500, Culture=de, PublicKeyToken=31bf3856ad364e35
DEBUG: Loaded into load context "Default" System.Runtime.Loader.DefaultAssemblyLoadContext #0: Microsoft.PowerShell.EditorServices.VSCode, Version=3.3.4.0, Culture=neutral, PublicKeyToken=null
PS > VERBOSE: Debug server started

@ohaak2 ohaak2 added the Issue-Bug A bug to squash. label May 4, 2022
@ghost ghost added the Needs: Triage Maintainer attention needed! label May 4, 2022
@Hetshu
Copy link

Hetshu commented May 4, 2022

I have the same Problem. It started when switching from Preview to Productive Extension. And I can't get rid of it by switching back to preview. Using WinPS 5.1 here, vscode 1.66.2 , ps ext 2022.5.0. Never had this problem before with all previous preview versions up to and including 2022.4.3. Reverting back to preview 2022.4.3 now does not fix the problem.
PS: Hitting Return in the terminal after F5 starts the debugger. Ctrl F5 is also affected. F10 after breakpoint is also affected.

@pwahlmueller
Copy link

pwahlmueller commented May 4, 2022

Same here.
Disabling all other extensions, all profiles and all settings did not help either.

@andyleejordan
Copy link
Member

I think I know what's going on here. As a workaround, when the temporary console is created, can you press a key in it (any key, enter is fine) to let it start?

@andyleejordan andyleejordan added Area-Debugging and removed Needs: Triage Maintainer attention needed! labels May 4, 2022
@andyleejordan andyleejordan self-assigned this May 4, 2022
@andyleejordan andyleejordan pinned this issue May 4, 2022
@ohaak2
Copy link
Author

ohaak2 commented May 4, 2022

@andschwa Yes, indeed. It's like @Hetshu already commented.

That way the script will be executed in run mode or I will hit the first breakpoint in debug mode, but going on from there with F10 or F11 will each also require a key stroke in the terminal.

@andyleejordan
Copy link
Member

Sorry about that! We'll get it fixed right away.

@ohaak2
Copy link
Author

ohaak2 commented May 4, 2022

@andschwa Awesome - thanks! Would be lost without your magnificent work here!

@andyleejordan
Copy link
Member

We'd be lost without our users and your prompt and specific bug reports!

@andyleejordan
Copy link
Member

Good news: I have a fix underway that seems to be working! Getting PRs up now, will have this in preview for testing ASAP!

@andyleejordan andyleejordan changed the title PowerShell session not loaded when powershell.debugging.createTemporaryIntegratedConsole set to 'true' Temporary integrated consoles stuck waiting for key press May 5, 2022
@andyleejordan andyleejordan moved this from Todo to In Progress in American Pharoah May 5, 2022
Repository owner moved this from In Progress to Done in American Pharoah May 5, 2022
@andyleejordan
Copy link
Member

@ohaak2, @Hetshu, @pwahlmueller: Just published v2022.5.1-preview with a fix for this. Will be on the marketplace shortly! Please give it a test for me.

@ohaak2
Copy link
Author

ohaak2 commented May 6, 2022

@andschwa Just switched my vscode to use the preview. Looks good - your fix seems to work. Good work - Thx!

@andyleejordan
Copy link
Member

Awesome, thanks so much for the verification!

@Hetshu
Copy link

Hetshu commented May 6, 2022

Yes worked for me too, thanks for the fast fixing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Status: Done
4 participants