microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
163.51k stars 28.98k forks source link

Opening a PowerShell 7 terminal in VSCode results in an infinite entering #231552

Open therealozp opened 20 hours ago

therealozp commented 20 hours ago

Does this issue occur when all extensions are disabled?: Yes/No

Steps to Reproduce:

  1. Kill the terminal
  2. Open the integrated terminal with the label pwsh (I assume this is the default for PowerShell 7

Image

Some notes:

albertosantini commented 17 hours ago

Just my two cents.

Anything in profile?

albertosantini commented 17 hours ago

Or something related to shell integration: https://code.visualstudio.com/docs/terminal/shell-integration

Maybe a try disabling it:

"terminal.integrated.shellIntegration.enabled": false

therealozp commented 10 hours ago

Nothing was originally in the PS profile.

I updated the profile with those found in the link provided above if ($env:TERM_PROGRAM -eq "vscode") { . "$(code --locate-shell-integration-path pwsh)" }, but it still had the same issue.

I cleared the profile and disabled shellIntegration, but the issue still occurs.

PowerShell seems to be doing fine in Windows Terminal, only in VSCode does this issue happen. Thanks for the help!

albertosantini commented 9 hours ago

Here I cannot reproduce it and I have almost the same setup (diff Windows 24H2).

When you start Powershell, you should see as first line PowerShell 7.4.5

And, please, check this:

Do you see the correct path for Powershell profile?

Image

albertosantini commented 9 hours ago

See also https://github.com/microsoft/vscode/issues/221686

therealozp commented 8 hours ago

The path for my PowerShell executable is correct. This is what I have right now: Image

As you said, when opening the terminal, it does briefly show the line Powershell 7.4.5 for a quick second, and then it just gets completely obliterated by the entering lines that follow it.

I don't have anything in my $PROFILE right now as the [#221686] thread might suggest, but I have gathered some logs with trace anyway. Please let me know if this helps:

terminal trace logs.txt