Skip to content

New 'PowerShell Extension Terminal' does not work with pwsh. #4111

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

Closed
4 of 6 tasks
ghost opened this issue Aug 5, 2022 · 5 comments · Fixed by #4121
Closed
4 of 6 tasks

New 'PowerShell Extension Terminal' does not work with pwsh. #4111

ghost opened this issue Aug 5, 2022 · 5 comments · Fixed by #4121
Assignees
Labels

Comments

@ghost
Copy link

ghost commented Aug 5, 2022

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

PowerShell Terminal crashes when PowerShell Core is installed. Without PowerShell Core, using version 5.1.20348.643, it opens normally.

PowerShell Version

Name                           Value
----                           -----
PSVersion                      7.2.5
PSEdition                      Core
GitCommitId                    7.2.5
OS                             Microsoft Windows 10.0.20348
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

1.70.0
da76f93349a72022ca4670c1b84860304616aaa2
x64

Extension Version

Steps to Reproduce

  1. Install PowerShell Core: dotnet tool install -g powershell.
  2. Open VS Code.
  3. Open a PowerShell Terminal inside VS Code.

Visuals

No response

Logs

PowerShell terminal:
Start-EditorServices: A positional parameter cannot be found that accepts argument 'Extension'.

Floating window:
The terminal process "C:\Users\myUser.dotnet\tools\pwsh.exe '-NoProfile', '-ExecutionPolicy', 'Bypass', '-Command', 'Import-Module 'c:\Users\myUser.vscode\extensions\ms-vscode.powershell-2022.7.2\modules\PowerShellEditorServices\PowerShellEditorServices.psd1'; Start-EditorServices -HostName 'Visual Studio Code Host' -HostProfileId 'Microsoft.VSCode' -HostVersion '2022.7.2' -AdditionalModules @('PowerShellEditorServices.VSCode') -BundledModulesPath 'c:\Users\myUser.vscode\extensions\ms-vscode.powershell-2022.7.2\modules' -EnableConsoleRepl -StartupBanner "PowerShell Extension v2022.7.2
Copyright (c) Microsoft Corporation.

https://aka.ms/vscode-powershell
Type 'help' to get help.
" -LogLevel 'Normal' -LogPath 'c:\Users\myUser\AppData\Roaming\Code\User\globalStorage\ms-vscode.powershell\logs\1659685232-9fc8272f-70bf-4533-9dea-97ca56801ead1659685205257\EditorServices.log' -SessionDetailsPath 'c:\Users\myUser\AppData\Roaming\Code\User\globalStorage\ms-vscode.powershell\sessions\PSES-VSCode-19184-566382.json' -FeatureFlags @() '" terminated with exit code: 1.

@ghost ghost added Issue-Bug A bug to squash. Needs: Triage Maintainer attention needed! labels Aug 5, 2022
@andyleejordan
Copy link
Member

@SeeminglyScience any idea here? My instinct says it's acting like there's an issue with the multi-line startup banner string, as that's the only thing with the word "Extension" in it.

@SeeminglyScience
Copy link
Collaborator

Looks like a problem with the dotnet global tool install of PowerShell. Unsure if it's us or if the way args are passed to it is a little wonky on the dotnet side.

In the mean time @alcarsa5 I'd highly recommend just installing the .msi version instead.

@ghost
Copy link
Author

ghost commented Aug 8, 2022

Thanks for the idea. Nevertheless, I found easier to use previous version of VS Code extension, which has no problems with pwsh. I hope you can found the cause soon :).

@Suriman
Copy link

Suriman commented Aug 8, 2022

The same thing happens to us in our company. Please see if you can prioritize fixing this issue.

@andyleejordan
Copy link
Member

Hi there, I can take a look at disabling the startup banner if we detect that we're using this dotnet install of PowerShell. Meanwhile, you can simply disable the startup banner itself:

"powershell.integratedConsole.suppressStartupBanner": true

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
3 participants