-
Notifications
You must be signed in to change notification settings - Fork 512
PowerShell Integrated Console starts when opening first PowerShell script #1169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The PowerShell Integrated Console does run profiles, but as it's a different Host, it doesn't use the same host specific profile:
The syntax coloring in the console is from the PSReadLine module and there is an open request on that already ( #535) |
@atkinsroy one note in reference this comment:
The extensions integrated console is required to be running in order for intellisense and other features within the editor (where you develop your scripts) to function. They go hand in hand. If you are working on a script where you are using a module say from PS Gallery, the first time you reference a command in that module the Editor service will load the module into that integrated terminal used by the extension. You then have intellisense on commands for that module. It works both ways. You can see the dependency this has by deleting that integrated terminal created by the extension. Once you do that you will lose all functionality of the extension. In reference to why it behaves differently is because it is not the same host as if you are using You can disable the integrated terminal from showing at all by setting |
Hi Shawn, Thanks for the follow up. I've done some reading and understand the need for the integrated console now. I just find that it crashes quite a bit, so I've learned to not rely on it for integrative sessions. I do miss out on RunSelections, but having colourisation is more important for me. |
@atkinsroy hey there, thanks for your concern! I will say that crashing is not a feature 🙂 If you ever experience a crash, we want to know about it so we can fix it. We try to make it as painless as possible to file issues so that we can get the info we need to fix the issues you're experiencing. Take a look out how to send us logs here: Don't hold back 💪 we can take it. |
Maybe separate these two things? Every time I open any PowerShell file, I have to close that dang console that pops up. It's death by a thousand paper-cuts, so I continue to use the ISE. Intellisense and editor services should a non-interactiver console it uses. Then, if I want to run an interactive console for debugging, I can open one. |
@splatteredbits you can resolve the terminal opening by setting the below to false in your user settings, by default it is set to true: // Shows the integrated console when the PowerShell extension is initialized.
"powershell.integratedConsole.showOnStartup": true The session starting has to happen as that is part of the editor services. You will not have all the features of the PowerShell extension with out them/it. |
@wsmelton That's not what I want. I want Intellisense and all that without a console opening. |
@splatteredbits Setting: {
"powershell.integratedConsole.showOnStartup": false
} Should give you intellisense without a console opening. If that's not happening, there's probably a bug. The console itself is just a window into the PowerShell session used to host EditorServices though. So console or not, there's a PowerShell process running in the background to provide intellisense. |
@rjmholt Yay. That works. I got confused about earlier statements that I would lose intellisense with that setting. |
Another ISE feature that has 'forced' me to use the Powershell Integrated Console is to highlight a portion of code, right-click and select 'Run Selection' (or F8). This code is only executed in the Integrated Console...and I didn't realize how much I relied on that button when developing scripts within the ISE. I too, was like many new comers to Code, or those of us that enjoy fine-tuned control of EVERYTHING (we are developers, engineers, and admins, after all), found the 'extra' Integrated console baffling at best and annoying at worse...especially since a 'normal' Powershell console loads as the terminal anyway. Lately, I've found myself using it almost exclusively though. Partly b/c of the F8 integration working (copying and pasting large sections of code into the terminal doesn't always work, as it tries to execute each line of code as it sees it...which is a pain for loops and other constructs) and partly since discovering that you can load a profile and that there has been some improvements with the colorization. Similar to ISE vs Powershell Console, it is another, separate executing environment, and as such there are slight variations in behavior (none of which have bitten me in the but...i think they are trying to mirror the console environment as closely as possible). But the neat-freak side of me says, give me one or the other. I understand that the Integrated Console is necessary to run the extension properly. Then just make the Integrated Console THE powershell console, make it pretty, and add the profile thing to Help or tooltips to make it easy for us noobs to figure that out. |
Is there any way to always open the powershell integrated console (the one included with the extension) over what you get when you just have powershell set as your terminal? |
Setting |
@TylerLeonhardt Yep that's the option that I unchecked. Restarted and all, but the integrated console still shows up whenever I open a My system info is below: Version: 1.42.1 (user setup) |
So what worked for me was to first uncheck "Show on Startup" and then open a cmd prompt and uncheck "Use legacy console.." in the properties. Restarted VSCode and boom, no more PowerShell window and my intellisense is still working. "Victory is mine!" - Stewie |
@raaaaaymond sorry since this issue is closed it slips under my radar... I would encourage you to open a new one with what you are seeing so we can be more responsive... Can you also try @DavidPeper's suggestion? Also, I'm curious what other VS Code settings you have set if you can also share those. @DavidPeper odd that that unblocked you.. I will look into that. You should be able to have both of those settings enabled... |
Thank you @TylerLeonhardt. I haven't tried @DavidPeper's suggestion because I think a recent update (14.3) magically fixed the problem. Thanks again. |
System Details
$PSVersionTable
:[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
PSVersion 5.1.14393.1944
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.14393.1944
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
I also have PowerShell Core, but this is not related, as I saw the same behaviour before installing this:
PSVersion 6.0.0
PSEdition Core
GitCommitId v6.0.0
OS Microsoft Windows 10.0.14393
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Note, I also had this problem before installing the shell launcher extension, as detailed above.
Issue Description
PowerShell Integrated Console automatically starts when opening first PowerShell script in session.
On my system, the PowerShell extension will open a console called "PowerShell Integrated Console" and switch to it when I open my first PowerShell script in the session. It does this even if I have another PowerShell console running. If I open VS Code and in the previous session I had a PowerShell script open, then the extension does the same thing (the console might be displayed or might be hidden).
I really don't like this behaviour - this console (labelled "PowerShell Integrated Console") behaves differently to other PowerShell consoles (e.g. it doesn't appear to run my profile, you cannot exit it and syntax colouring doesn't work).
I've improved things by using the following user setting; at least now when the console is created, I don't get switched, so its easier to ignore, but it still appears in my console list.
"powershell.integratedConsole.showOnStartup": false,
I'd really like a way to stop this console from starting. If I press ctrl ` I get a correctly behaving PowerShell console (labelled "powershell") and the same thing if the console window opens from last session. Can I suggest:
"powershell.integratedConsole.showOnFileOpen"
Attached Logs
vscode.zip
The text was updated successfully, but these errors were encountered: