PowerShell Integrated Console (PSIC) is not created on VSCode startup
See original GitHub issueSystem Details Output
### VSCode version: 1.48.0 db40434f562994116e5b21c24015a2e40b2504e6 x64
### VSCode extensions:
amazonwebservices.aws-toolkit-vscode@1.12.0
arcticicestudio.nord-visual-studio-code@0.14.0
dracula-theme.theme-dracula@2.22.1
eamodio.gitlens@10.2.2
EliverLara.andromeda@1.7.0
formulahendry.code-runner@0.11.0
icsharpcode.ilspy-vscode@0.9.0
johnpapa.vscode-peacock@3.8.0
ms-azuretools.vscode-azurefunctions@0.23.0
ms-azuretools.vscode-docker@1.5.0
ms-dotnettools.csharp@1.23.1
ms-python.python@2020.8.101144
ms-vscode-remote.remote-containers@0.134.1
ms-vscode-remote.remote-ssh@0.51.0
ms-vscode-remote.remote-ssh-edit@0.51.0
ms-vscode-remote.remote-wsl@0.44.4
ms-vscode.azure-account@0.9.2
ms-vscode.cpptools@0.29.0
ms-vscode.powershell@2020.6.0
ms-vscode.powershell-preview@2020.7.0
ritwickdey.LiveServer@5.6.1
usernamehw.errorlens@3.2.0
webrender.synthwave-x-fluoromachine@0.0.12
### PSES version:
### PowerShell version:
Name Value
---- -----
PSVersion 7.0.3
PSEdition Core
GitCommitId 7.0.3
OS Microsoft Windows 10.0.19041
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Issue Description
I was trying to debug the root cause for Intellisense not working in the VSCode-PowerShell extension, when I came across the following error message in the vscode-powershell.log
file, in my diagnostic logs folder.
PSIC is not active terminal. Running in active terminal using 'runSelectedText'
I had to create a dummy script, use F5 to run that, and then the PSIC got created. Suddenly, Intellisense for third-party modules / objects started working again.
Question: Is there some way to ensure that PSIC is always spun up when VSCode is re-launched, when a PowerShell script file is opened up? I wonder if this is partly why people are having so many problems with broken Intellisense.
Expected Behaviour
Intellisense works at startup
Actual Behaviour
Intellisense for third-party entities (modules, .NET libraries, etc.) doesn’t work on VSCode startup.
Known Work-around
- Create a dummy PowerShell script
- Use
F5
to invoke the dummy script - Intellisense starts working in PSIC
Related Issues
There are only two mentions of the exact log message that I pasted above, but neither one seems to address the PSIC not being created at startup time.
Issue Analytics
- State:
- Created 3 years ago
- Comments:13 (4 by maintainers)
Top GitHub Comments
@pcgeek86 get rid of this setting:
does that change anything?
It seems like a bug that completions don’t occur if the PSIC isn’t visible though. I wonder what causes that.
To do that, the extension client would need to find that PowerShell process and inject the server into it. In general with other processes, that’s not possible, but PowerShell does listen for
Enter-PSHostProcess
connections. Naturally to connect to one of those you need anEnter-PSHostProcess
client, which means a PowerShell process, so you’re back to where you started. Moreover, it would just take your initialpwsh
instance and turn it into the PSIC; any reason you might have to usepwsh
over the PSIC would evaporate.