Vscode-powershell: Allow to hide the PowerShell Integrated Console from the user

Created on 24 Jan 2020  路  8Comments  路  Source: PowerShell/vscode-powershell

Summary of the new feature

As a user I want autocompletion etc., but without having the PowerShell Integrated Console in my Terminal view, so that when I open the Terminal view, I don't accidentally start using it.

Say I have 5 files open in VS Code: if none of them is a PowerShell script and I hit Ctrl+`, VS Code gives me a standard powershell terminal that I can use straightaway. However, if I happen to have a PowerShell script open, I just get the already-running PowerShell Integrated Console (which I don't want to use, because it doesn't quite work the same like a standard terminal).

Proposed technical implementation details

If I understand this correctly, there's a TerminalOptions.hideFromUser API to do exactly this.

So what I'd like to have, is an extension setting to specify that the PowerShell Integrated Console should be launched with hideFromUser set to true.

All 8 comments

Does this also cover your case?

"powershell.integratedConsole.showOnStartup": false

Does this also cover your case?

It doesn't: that setting only prevents the Terminal view from being shown as soon as a PowerShell script is opened, but the PowerShell Integrated Console is still there. So when I hit Ctrl + `, I'll end up in the PowerShell Integrated Console, rather than a standard powershell terminal.

The PowerShell Integrated Console is needed to get debugging working because debugging PowerShell script requires some console output.

In order to light up what you're asking for that would mean that debugging would not be possible.

We could have a mode like that, but I personally feel like

"powershell.integratedConsole.showOnStartup": false

gets us 80% of the way there and is already supported.

I don't know the TerminalOptions.hideFromUser API that @Tyriar mentioned, but he said

extensions can create backgrounded terminals and only surface them in the UI when the user requests them

so as I read it, from an extension POV, the terminal would work exactly the same (i.e. the extension can still write output to it), and it's still possible for the user to request the terminal to be shown when they want to debug PowerShell scripts and see the output.

@Tyriar is it possible to unhide a terminal?

@TylerLeonhardt you can use hideFromUser, the first time Terminal.show() is called it will just be like a regular terminal. So you can unhide it, but you can't re-hide it.

Gotcha. So I guess we can kinda support this by using hideFromUser at start up instead of "not running show" and then debugging should "unhide" the terminal.

Unfortunately, once it's shown, we wouldn't be able to re-hide it like you said... but this should be good for @anthonyvdotbe maybe?

Yes, this would be great, thanks.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lukegriffith picture lukegriffith  路  3Comments

TheDanishDynamo picture TheDanishDynamo  路  3Comments

nathan-alden-hp picture nathan-alden-hp  路  3Comments

timoline picture timoline  路  3Comments

CJHarmath picture CJHarmath  路  3Comments