vscode-powershell icon indicating copy to clipboard operation
vscode-powershell copied to clipboard

Cannot open a Terminal session

Open SlkRck opened this issue 6 years ago • 9 comments

I'm receiving the error mentioned in other threads -- PLUS the fact I cannot open a terminal. I uninstalled VSCode completely, rebooted, reinstalled and before installing any PowerShell extensions, tried to open a terminal and it failed with the error:

The terminal process command 'C:\Program Files\PowerShell\7\pwsh.exe' failed to launch (exit code: {2})

SlkRck avatar Mar 31 '20 21:03 SlkRck

@SlkRck could you please specify the other issue you are referring to...from the looks of the error it seems that PowerShell isnt properly getting picked up on your system...could you please also specify your system information ie. any VSCode settings, what OS you are using, and what versions of PowerShell are installed on your system? Thanks!

SydneyhSmith avatar Mar 31 '20 21:03 SydneyhSmith

I have two issues:

  1. No ability to open a new Terminal. It closes with the error message:The terminal process command 'C:\Program Files\PowerShell\7\pwsh.exe' failed to launch (exit code: {2})
  2. When attempting to install the PowerShell extension I received the error: Language Server startup failed.

The VSCode settings are all default. I am using Windows 10.0.19041. I have PowerShell version 7.0.0

SlkRck avatar Mar 31 '20 21:03 SlkRck

Thanks @SlkRck could you please try re-producing this issue with Windows PowerShell set as your default powershell version so we can determine if this is isolated to PowerShell 7...to do this open your VSCode settings file and add " "powershell.powerShellDefaultVersion": "Windows PowerShell (x64)",

SydneyhSmith avatar Apr 02 '20 21:04 SydneyhSmith

Here is what the setting file looks like image I still receive the error: The terminal process command 'C:\Program Files\PowerShell\7\pwsh.exe' failed to launch (exit code: {2})

SlkRck avatar Apr 14 '20 05:04 SlkRck

Oh you said before you installed any PowerShell extensions, you received this error.

Do you remember how you installed PowerShell 7? Was it through the MSI?

Also, does PowerShell 7 launch normally outside of VS Code?

This issue should go into Microsoft/vscode instead, but we can keep it here for now until we get more info.

cc @Tyriar

TylerLeonhardt avatar Apr 14 '20 14:04 TylerLeonhardt

OK...maybe I wasnt clear:

Everything worked BEFORE I installed PowerShell 7. I uninstalled everything after it stopped working and tried reinstalling piece by piece.

PowerShell 7 works perfectly outside of VS Code. I installed PowerShell 7 using the MSI.

SlkRck avatar Apr 14 '20 15:04 SlkRck

@SlkRck thanks for all the info, one more thing that would be helpful for you to try, are you able to open PowerShell 7 as your terminal in VSCode (not the integrated terminal): defaultshell

SydneyhSmith avatar Apr 14 '20 22:04 SydneyhSmith

Do you have anti-virus installed that could be blocking the terminal? https://code.visualstudio.com/docs/editor/integrated-terminal#_how-do-i-fix-the-errors-connectnamedpipe-failed-windows-error-232-or-terminal-exited-with-code-x-on-windows

Tyriar avatar Apr 15 '20 13:04 Tyriar

This issue is being closed as inactive, if this issue is still occurring it will be re-opened

ghost avatar May 01 '20 01:05 ghost