Vscode-powershell: PowerShell Integrated Console appears to start twice

Created on 23 Mar 2017  路  10Comments  路  Source: PowerShell/vscode-powershell

System Details

  • Operating system name and version: Windows 10 AU
  • VS Code version: 1.10.2
  • PowerShell extension version: 0.11.0
  • Output from $PSVersionTable:
Name                           Value
----                           -----
PSVersion                      5.1.14393.953
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.14393.953
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Issue Description

When I open a PS workspace in VSCode the first time, the integrated console appears to load twice:
pses-ic-startup
I also notice that the first time, it displays the logo but then the screen is cleared and it says it's starting PowerShell again. Is this the new host that loads the second time? If so, maybe it could say Starting the PowerShell Integrated Console...? If we can't prevent the first (original) load, we may want to see if we can start PowerShell with -NoLogo. For the final load, do we want to show a logo? Perhaps with a setting to disable it?

Attached Logs

N/A I think. If that's not the case, let me know and I can attach them.

vscode-bug

Most helpful comment

Can confirm, I just got so used to it happening that I never stopped to notice when it didn't happen. Cool beans!

All 10 comments

VS Code is doing this, here's the issue I filed against them about it: https://github.com/Microsoft/vscode/issues/22968

Basically, when VS Code restarts, it remembers that a terminal was open when the window was closed the previous time and then launches the terminal UI using your default terminal preference just before I have a chance to start the integrated console. I have tried a few different ways of suppressing it but nothing has worked yet.

Wouldn't a better process be to set something in terminal.integrated.shell.windows that would start the extension and the integrated terminal?

This would set a user setting that would prevent accidently killing whatever other terminal may or may not be wanted. It would also be more efficient if the default powershell is loading with a profile.

Now that https://github.com/Microsoft/vscode/issues/13267 is closed, can we revisit this? It is super annoying still...

It looks like this is no longer occurring. Closing this now, but can reopen if needed

Can confirm, I just got so used to it happening that I never stopped to notice when it didn't happen. Cool beans!

@rjmholt @TylerLeonhardt Actually this is still an issue at least with "Reload Window" and should be reopened, I just didn't look closely enough.

Steps to reproduce:

  1. Start window with Powershell Integrated Terminal
  2. Choose "Reload Window"
  3. A pwsh terminal in addition to integrated terminal will be started.

Expected behavior

Only the Powershell Integrated Terminal should be started upon a reload window if it was the only terminal open previously.
Capture

ah I see... that's because the Terminal pane is open and by default it opens your default shell...

ah I see... that's because the Terminal pane is open and by default it opens your default shell...

Correct, in the past there was nothing you could do about it, but you should be able to now with https://github.com/microsoft/vscode/issues/13267

Yeah but... I don't know if we want to mess with other terminals... could be dangerous. The user might have been already running something in that other terminal.

Related issue that was abandoned.
https://github.com/microsoft/vscode/issues/39137

Here's a workaround script maybe that can be integrated
https://github.com/microsoft/vscode/issues/39137#issuecomment-414127477

EDIT: Also a dispose API for terminals if we can establish some safe parameters (e.g. Extension has just started on startup/reload, Integrated Console was open previously, new terminal is less than 5 seconds old, etc.)
https://github.com/microsoft/vscode/issues/39137#issuecomment-539584642

Was this page helpful?
0 / 5 - 0 ratings

Related issues

GQnzo picture GQnzo  路  3Comments

rkeithhill picture rkeithhill  路  3Comments

daviwil picture daviwil  路  3Comments

guidooliveira picture guidooliveira  路  3Comments

pcgeek86 picture pcgeek86  路  4Comments