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

I want F8 to run selected text in the active terminal, not just in the "Integrated PowerShell Console" #1607

Closed
alexandair opened this issue Nov 9, 2018 · 5 comments · Fixed by #1619
Labels
Issue-Discussion Let's talk about it.

Comments

@alexandair
Copy link

I would like F8 to run a selected text in any active terminal, not just in the "Integrated PowerShell Console".

I use more and more PowerShell Core in WSL terminal in VSCode and it would be nice to use F8 to run selected text in that terminal too.

@TylerLeonhardt
Copy link
Member

first off, I want to say, I'm on your side and think that we should change the F8 to "Terminal: Run selected text in the active terminal" or have a setting to easily configure it.

the biggest problem I have with changing it is this... we will need to educate our customers that don't understand what the PowerShell Integrated Console is.

I've had so many people come up to me and say "I don't want to use the PowerShell Integrated Console. I want to use the default one (powershell.exe) because it has PSReadLine and is better"

and they don't understand that, if they use "Terminal: Run selected text in the active terminal" with "powershell.exe" that whatever they're running there WILL NOT show up in the Editor at all

and a lot of customers don't understand this

they don't understand why the PowerShell Integrated Console is there. Why it's so important

why it's taken AGES to get PSReadLine to work in it ( ;) @SeeminglyScience )

but the scenario that you've brought up make a TON of sense!

"I want to F8 and run something in CloudShell"
"I want to run a command in WSL powershell"

Let's get some feedback from folks and see what makes the most sense to enable both scenarios.

@SeeminglyScience
Copy link
Collaborator

SeeminglyScience commented Nov 13, 2018

It's set up that way because when the integrated console was added there was no way to tell what the current focused terminal was. So instead it just always moves the focus to the integrated console.

There's been a bunch of API improvements since then though, so it might be possible now.

the biggest problem I have with changing it is this... we will need to educate our customers that don't understand what the PowerShell Integrated Console is.

As long as it's a setting that isn't on by default we should be fine. I don't think there is a ton of overlap between the type of folks who aren't familiar with the PSIC and the type to do heavy customization.

Edit: Actually looks like the required API's were just added:

The proposed APIs that give access to the active terminal, window.activeTerminal and window.onDidChangeActiveTerminal, are now stable.

@rjmholt rjmholt added the Issue-Discussion Let's talk about it. label Nov 13, 2018
@TylerLeonhardt
Copy link
Member

Oh I just thought of something... I bet the "Terminal: Run selected text in the active terminal" command doesn't handle multi-line well because we don't handle multi-line well.

It will work fine in the CloudShell one because of PSReadLine there... But for us it won't be a good experience, today at least.

@SeeminglyScience
Copy link
Collaborator

@TylerLeonhardt Yeah, that's why I say those API's are required. The idea would be to check if the integrated console is focused. If it is, then send the custom LSP request to PSES. If it isn't, then call the VSCode command.

@alexandair
Copy link
Author

@TylerLeonhardt Yes, "Terminal: Run selected text in the active terminal" command doesn't handle multi-line well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Discussion Let's talk about it.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants