Skip to content
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

Allow to hide the PowerShell Integrated Console from the user #2434

Closed
anthonyvdotbe opened this issue Jan 24, 2020 · 8 comments · Fixed by #2437
Closed

Allow to hide the PowerShell Integrated Console from the user #2434

anthonyvdotbe opened this issue Jan 24, 2020 · 8 comments · Fixed by #2437

Comments

@anthonyvdotbe
Copy link

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.

@Tyriar
Copy link
Contributor

Tyriar commented Jan 24, 2020

Does this also cover your case?

"powershell.integratedConsole.showOnStartup": false

@anthonyvdotbe
Copy link
Author

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.

@TylerLeonhardt
Copy link
Member

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.

@anthonyvdotbe
Copy link
Author

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.

@TylerLeonhardt
Copy link
Member

@Tyriar is it possible to unhide a terminal?

@Tyriar
Copy link
Contributor

Tyriar commented Jan 24, 2020

@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.

@TylerLeonhardt
Copy link
Member

TylerLeonhardt commented Jan 24, 2020

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?

@anthonyvdotbe
Copy link
Author

Yes, this would be great, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants