question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

PowerShell Integrated Console (PSIC) is not created on VSCode startup

See original GitHub issue

System 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.

image

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

  1. Create a dummy PowerShell script
  2. Use F5 to invoke the dummy script
  3. Intellisense starts working in PSIC

Related Issues

#2745

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.

image

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:13 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
TylerLeonhardtcommented, Aug 20, 2020

@pcgeek86 get rid of this setting:

"powershell.integratedConsole.showOnStartup": false,

does that change anything?

0reactions
rjmholtcommented, Aug 21, 2020

It seems like a bug that completions don’t occur if the PSIC isn’t visible though. I wonder what causes that.

Is there some way for the extension to piggy back on the pwsh instance, instead of spinning up a second one (PSIC)?

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 an Enter-PSHostProcess client, which means a PowerShell process, so you’re back to where you started. Moreover, it would just take your initial pwsh instance and turn it into the PSIC; any reason you might have to use pwsh over the PSIC would evaporate.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Making VS Code's Powershell Integrated Console useful
I recently started using VS Code pretty heavily and I've had a fun time configuring it - especially getting synth wave glow working!...
Read more >
PowerShell - Bountysource
I'm trying to move from PowerShell ISE to VS Code (and convince 15 coworkers to do the same). The PowerShell Integrated Console (PSIC)...
Read more >
How can I use the "PowerShell Integrated Console" in VS Code?
Use the PowerShell: Show Integrated Console command from the command palette. Additionally, you may assign a keyboard shortcut to the command, ...
Read more >
How do I make VS Code open only the PowerShell integrated ...
I just want to open VS Code and have it open the PowerShell Integrated Console and no other terminals. Unfortunately it is hell-bent...
Read more >
Veronique Lengelle on Twitter: "After the #PSCore advertising ...
After the #PSCore advertising when opening #PowerShell, we have the #PSIC design when switching to the PowerShell Integrated console.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found