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

Powershell extension terminal launches but never gets to a prompt. #5135

Open
5 of 6 tasks
DCoates-InnovateLtd opened this issue Feb 2, 2025 · 7 comments
Open
5 of 6 tasks
Labels
Issue-Bug A bug to squash. Needs: Fix Verification Please verify the fix for us! Resolution-Answered Will close automatically.

Comments

@DCoates-InnovateLtd
Copy link

Prerequisites

  • I have written a descriptive issue title.
  • I have searched all open and closed 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

When i open my powershell script and try and run the script 'F5' the terminal window launches but never gets to a prompts. iv waited over 20 mins.
I have checked AntiVirus etc and re-installed the extension and updated powershell 7 to the latest version. annoyingly it ran last night but not today.

Terminal Prompt:
PowerShell Extension v2025.0.0
Copyright (c) Microsoft Corporation.

https://aka.ms/vscode-powershell
Type 'help' to get help.

PowerShell Version

Name                           Value                                                                                   
----                           -----                                                                                   
PSVersion                      5.1.26100.2161                                                                          
PSEdition                      Desktop                                                                                 
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                                                 
BuildVersion                   10.0.26100.2161                                                                         
CLRVersion                     4.0.30319.42000                                                                         
WSManStackVersion              3.0                                                                                     
PSRemotingProtocolVersion      2.3                                                                                     
SerializationVersion           1.1.0.1

Visual Studio Code Version

1.96.4
cd4ee3b1c348a13bafd8f9ad8060705f6d4b9cba
x64

Extension Version

Steps to Reproduce

Open VS Code --> open powershell script file --> launch powershell terminal or run pressing F5. we then see it launches but doesn't complete.

Visuals

No response

Logs

Debug Level Output:
2025-02-02 20:39:53.830 [info] Visual Studio Code: v1.96.4 64-bit on Windows 64-bit
2025-02-02 20:39:53.830 [info] PowerShell Extension: v2025.0.0
2025-02-02 20:39:54.512 [info] Starting 'Windows PowerShell (x64)' at: C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe
2025-02-02 20:39:55.003 [info] PowerShell process started with PID: 13132
2025-02-02 20:43:50.761 [warning] PowerShell process terminated or Extension Terminal was closed, PID: 13132
2025-02-02 20:43:50.761 [debug] Disposing PowerShell process with PID: 13132
2025-02-02 20:43:51.278 [info] Language service connection closed.
2025-02-02 20:43:51.290 [info] [PSES] [Error - 8:43:51 PM] Server initialization failed.
2025-02-02 20:43:51.291 [info] [PSES] Message: Pending response rejected since connection got disposed
Code: -32097
2025-02-02 20:43:51.291 [info] [PSES] [Error - 8:43:51 PM] Connection to PowerShell Editor Services (the Extension Terminal) was closed. See below prompt to restart!
2025-02-02 20:43:51.291 [info] [PSES] [Error - 8:43:51 PM] PowerShell Editor Services Client client: couldn't create connection to server.
2025-02-02 20:43:51.291 [info] [PSES] Message: Pending response rejected since connection got disposed
Code: -32097
2025-02-02 20:43:51.292 [debug] Session status changing from 'Starting' to 'Failed'.
2025-02-02 20:43:51.292 [error] Never finished startup!
2025-02-02 20:44:19.795 [info] PowerShell Extension Terminal is not active! Running in current terminal using 'runSelectedText'.
2025-02-02 20:44:24.432 [debug] Previously failed, starting again.
2025-02-02 20:44:24.432 [debug] Session status changing from 'Failed' to 'Starting'.
2025-02-02 20:44:24.437 [debug] Finding PowerShell...
2025-02-02 20:44:24.533 [debug] Session status changing from 'Starting' to 'Starting'.
2025-02-02 20:44:24.533 [info] Starting 'Windows PowerShell (x64)' at: C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe
2025-02-02 20:44:24.534 [debug] Starting process: C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -ExecutionPolicy Bypass -Command Import-Module 'c:\Users\David.vscode\extensions\ms-vscode.powershell-2025.0.0\modules\PowerShellEditorServices\PowerShellEditorServices.psd1'; Start-EditorServices -HostName 'Visual Studio Code Host' -HostProfileId 'Microsoft.VSCode' -HostVersion '2025.0.0' -BundledModulesPath 'c:\Users\David.vscode\extensions\ms-vscode.powershell-2025.0.0\modules' -EnableConsoleRepl -StartupBanner "PowerShell Extension v2025.0.0
Copyright (c) Microsoft Corporation.

https://aka.ms/vscode-powershell
Type 'help' to get help.
" -LogLevel 'Warning' -LogPath 'c:\Users\David\AppData\Roaming\Code\logs\20250202T203945\window1\exthost\ms-vscode.powershell' -SessionDetailsPath 'c:\Users\David\AppData\Roaming\Code\User\globalStorage\ms-vscode.powershell\sessions\PSES-VSCode-12640-243079.json' -FeatureFlags @()
2025-02-02 20:44:24.852 [info] PowerShell process started with PID: 12892
2025-02-02 20:44:24.852 [debug] Waiting for session file: file:///c%3A/Users/David/AppData/Roaming/Code/User/globalStorage/ms-vscode.powershell/sessions/PSES-VSCode-12640-243079.json
2025-02-02 20:44:27.972 [debug] Session file found.
2025-02-02 20:44:27.974 [debug] Session details: {
"status": "started",
"languageServiceTransport": "NamedPipe",
"languageServicePipeName": "\\.\pipe\PSES_hzz2nij3.21z",
"debugServiceTransport": "NamedPipe",
"debugServicePipeName": "\\.\pipe\PSES_rrmagyrw.lsc",
"powerShellVersion": "5.1.26100.2161"
}
2025-02-02 20:44:27.974 [debug] Connecting to language service...
2025-02-02 20:44:27.977 [debug] Language service connected.

@DCoates-InnovateLtd DCoates-InnovateLtd added Issue-Bug A bug to squash. Needs: Triage Maintainer attention needed! labels Feb 2, 2025
Copy link

We've found some similar issues:

If any of the above are duplicates, please consider closing this issue out and adding additional context in the original issue.

Note: You can give me feedback by 👍 or 👎 this comment.

@andyleejordan
Copy link
Member

Per your log info you're using Windows PowerShell 5.1, which is supported on a best effort basis. Please try changing your extension terminal session (using the command "Show Session Menu") to the PowerShell 7 version you've stated you've installed/updated.

@andyleejordan andyleejordan added Resolution-Answered Will close automatically. and removed Needs: Triage Maintainer attention needed! labels Feb 4, 2025
Copy link
Contributor

github-actions bot commented Feb 4, 2025

This issue has been labeled as resolved, please verify the provided fix (or other reason).

@github-actions github-actions bot added the Needs: Fix Verification Please verify the fix for us! label Feb 4, 2025
@rfolkers
Copy link

rfolkers commented Feb 5, 2025

I''m experiencing the exact same issue!
If I run the following in a standalone pwsh terminal, so outside of VSCode:

Import-Module "C:\Users{Username}.vscode\ms-vscode.powershell-2025.0.0\modules\PowerShellEditorServices\PowerShellEditorServices.psd1"

Start-EditorServices

Nothing happens besides a never ending blinking cursor and the pwsh process is consuming 1 CPU core.

@github-actions github-actions bot added Needs: Maintainer Attention Maintainer attention needed! and removed Needs: Fix Verification Please verify the fix for us! labels Feb 5, 2025
Copy link
Contributor

github-actions bot commented Feb 5, 2025

This issue has been labeled as resolved, please verify the provided fix (or other reason).

@github-actions github-actions bot added Needs: Fix Verification Please verify the fix for us! and removed Needs: Maintainer Attention Maintainer attention needed! labels Feb 5, 2025
@andyleejordan
Copy link
Member

Hi,

Could you please provide more logging and environment information by following these steps?

Thanks!

@github-actions github-actions bot removed the Needs: Fix Verification Please verify the fix for us! label Feb 6, 2025
Copy link
Contributor

github-actions bot commented Feb 6, 2025

This issue has been labeled as resolved, please verify the provided fix (or other reason).

@github-actions github-actions bot added the Needs: Fix Verification Please verify the fix for us! label Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug A bug to squash. Needs: Fix Verification Please verify the fix for us! Resolution-Answered Will close automatically.
Projects
None yet
Development

No branches or pull requests

3 participants