You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
PowerShell Integrated Console appears to start twice #604
When I open a PS workspace in VSCode the first time, the integrated console appears to load twice:
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.
VS Code is doing this, here's the issue I filed against them about it: microsoft/vscode#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.
Rob Holt (@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:
Start window with Powershell Integrated Terminal
Choose "Reload Window"
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.
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.
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.) microsoft/vscode#39137 (comment)
This is still feels like it should be fixed by the vscode team. The argument that they're restoring state doesn't track: If I didn't have a pwsh (or whatever) open in the Terminal tab when I closed the window, why is it being 'restored'?
We're not the only ones complaining about this. I don't know if a new settings option would even be necessary: If I have both of the persist settings set as such:
...it's pretty clear I don't want the application opening a terminal for me. Regardless, I'll try to find some time to carefully read the open issue and make a persuasive argument.
This appears to have been addressed in v2023.6.0 (June 2023), which refactored the client startup logic so a ghost Extension Terminal can't be created, and #4599 made sessionManager.start() idempotent so the session can't start twice. If you still see this on a current version, please comment with fresh repro steps and logs and we'll reopen.
Activity
daviwil commentedon Mar 23, 2017
VS Code is doing this, here's the issue I filed against them about it: microsoft/vscode#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.
jmiller76 commentedon Oct 31, 2017
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.
JustinGrote commentedon Aug 20, 2018
Now that microsoft/vscode#13267 is closed, can we revisit this? It is super annoying still...
rjmholt commentedon Mar 17, 2020
It looks like this is no longer occurring. Closing this now, but can reopen if needed
JustinGrote commentedon Mar 17, 2020
Can confirm, I just got so used to it happening that I never stopped to notice when it didn't happen. Cool beans!
JustinGrote commentedon Mar 18, 2020
Rob Holt (@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:
Expected behavior
Only the Powershell Integrated Terminal should be started upon a reload window if it was the only terminal open previously.

TylerLeonhardt commentedon Mar 18, 2020
ah I see... that's because the Terminal pane is open and by default it opens your default shell...
JustinGrote commentedon Mar 18, 2020
Correct, in the past there was nothing you could do about it, but you should be able to now with microsoft/vscode#13267
TylerLeonhardt commentedon Mar 18, 2020
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.
JustinGrote commentedon Mar 18, 2020
Related issue that was abandoned.
microsoft/vscode#39137
Here's a workaround script maybe that can be integrated
microsoft/vscode#39137 (comment)
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.)
microsoft/vscode#39137 (comment)
aproposts commentedon Jul 5, 2023
This is still feels like it should be fixed by the vscode team. The argument that they're restoring state doesn't track: If I didn't have a
pwsh(or whatever) open in the Terminal tab when I closed the window, why is it being 'restored'?We're not the only ones complaining about this. I don't know if a new settings option would even be necessary: If I have both of the persist settings set as such:
...it's pretty clear I don't want the application opening a terminal for me. Regardless, I'll try to find some time to carefully read the open issue and make a persuasive argument.
andyleejordan commentedon Jul 5, 2023
We would definitely appreciate that, requests come best from the users themselves!
andyleejordan commentedon Jun 15, 2026
This appears to have been addressed in v2023.6.0 (June 2023), which refactored the client startup logic so a ghost Extension Terminal can't be created, and #4599 made
sessionManager.start()idempotent so the session can't start twice. If you still see this on a current version, please comment with fresh repro steps and logs and we'll reopen.🤖 Drafted by GitHub Copilot at Andy Jordan (@andyleejordan)'s request — pending maintainer review.