Skip to content

Multiple PowerShell Integrated Console tabs in Terminal #2418

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

Open
dshuffmaPS opened this issue Jan 15, 2020 · 5 comments
Open

Multiple PowerShell Integrated Console tabs in Terminal #2418

dshuffmaPS opened this issue Jan 15, 2020 · 5 comments
Labels
Area-Extension Terminal Issue-Enhancement A feature request (enhancement).

Comments

@dshuffmaPS
Copy link

Background:
I'm trying to move from PowerShell ISE to VS Code (and convince 15 coworkers to do the same). The PowerShell Integrated Console (PSIC) tab gives me the ability to have a script in the editor and hit F5 to make it run in the terminal. A normal "powershell" terminal tab will not react to the editor (seems totally disconnected). Same time, if you try to Split the PSIC window, the split screen is also just a normal "powershell" window. So once the one PSIC tab is running, you have to wait until it's done to launch another script from the terminal (an issue if you have a couple scripts to run, each going an hour at a time). The only work-around is to open a new VS Code instance, load up the script there, and run it. This is in contrast to ISE where you can open a new console tab, open the editor for it, and run your script (so 1 ISE window vs multiple VS Code instances).

Request:
So, the feature I'm hoping to see is the ability to have multiple PowerShell Integrated Console tabs in Terminal in order to be able to run multiple scripts from the editor.

PS:
I'm sorry if this isn't the right label or location. New to seeking help, this is my fourth location for this issue 😄. To be honest, I'm not sure if this is something that should work but doesn't, doesn't exist yet (or can't exist ever), or if I'm just missing it.

@ghost ghost added the Needs: Triage Maintainer attention needed! label Jan 15, 2020
@rjmholt rjmholt added Area-Extension Terminal Issue-Enhancement A feature request (enhancement). labels Jan 15, 2020
@SydneyhSmith
Copy link
Collaborator

@dshuffmaPS thanks for opening this issue, you have found the right place for this request 😄

You mention that you have have multiple terminal tabs, while they still wont be "integrated" in terms of state, you can still run your selected code using f8 and it will run in whatever is the active terminal below.

We don't have any plans to support this in the near future, and it would likely be a large undertaking but as an open source project we prioritize our workflow based on GitHub issues primarily so if this gets "up votes" it could be something we investigate.

Thanks again for taking the time for the feature request!

@SydneyhSmith SydneyhSmith removed the Needs: Triage Maintainer attention needed! label Jan 16, 2020
@dshuffmaPS
Copy link
Author

@SydneyhSmith Thanks so much for the reply! While I do like the idea of the feature still due to smaller things like it ignoring comment lines, I (shamefully) didn't even consider that f8 would give me some additional functionality that works as a sufficient work around!

@ghost ghost added the Needs: Maintainer Attention Maintainer attention needed! label Jan 17, 2020
@rjmholt
Copy link
Contributor

rjmholt commented Jan 17, 2020

Another thing to look into is the temp debugging feature, which runs a script in a new process.

I should also mention that one of the complicating factors for having multiple Integrated Consoles is the integration. The Integrated Console is just a REPL on top of the PowerShell process running all language service operations. Things like completions and references are stateful in PowerShell, so they depend on other things you've executed so far, and the Integrated Console tracks all that.

For us to support multiple Integrated Consoles, we'd need to support multiplexing between different PowerShell processes (while keeping them all alive). That's not impossible, but it's also a significant architectural departure from what we have today. It's also fairly heavyweight, and we already have issues open on the footprint of the PowerShell extension as is (because of the number of files PowerShell touches on a system, this is hard to mitigate).

We have discussed moving things out of process in various cases, but due to the nature of PowerShell it's very hard to do correctly; a lot of PowerShell (both the engine and scripts people write) assume things run in-process.

With all that said, we might be able to revisit this one day, but not in the medium term timeframe.

@SydneyhSmith SydneyhSmith removed the Needs: Maintainer Attention Maintainer attention needed! label Jan 17, 2020
@Andy-AO
Copy link

Andy-AO commented Dec 11, 2020

For me, this can greatly improve the experience

@ghost ghost added the Needs: Maintainer Attention Maintainer attention needed! label Dec 11, 2020
@rjmholt rjmholt removed the Needs: Maintainer Attention Maintainer attention needed! label Dec 11, 2020
@wsmelton
Copy link

wsmelton commented May 23, 2021

You can tell the extension to use the Terminal that is part of VS Code and note the Integrated Terminal.

This setting was added in 2020 to the extension settings powershell.integratedConsole.showOnStartup. This will cause when you hit F5 or "run selection" (right-click context) to execute in Code's terminal. Be aware that once you start opening multiple terminal though, the execution of code from the editor will always be in the last terminal of focus.

Debugging will still use the Integrated Terminal since it has a dependency but use the setting above will allow the multiple terminals to be used as part of Code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Extension Terminal Issue-Enhancement A feature request (enhancement).
Projects
None yet
Development

No branches or pull requests

5 participants