Skip to content

F5 Shifts Focus to Integrated Console #1058

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

Closed
grumpkin opened this issue Oct 18, 2017 · 10 comments
Closed

F5 Shifts Focus to Integrated Console #1058

grumpkin opened this issue Oct 18, 2017 · 10 comments

Comments

@grumpkin
Copy link

System Details

  • Operating system name and version: Windows 10 1607
  • VS Code version: 1.17.1
  • PowerShell extension version: 1.4.3
Copy / paste the following commands into the PowerShell Integrated Console, and paste the output here:

code -v:
1.17.1
1e9d36539b0ae51ac09b9d4673ebea4e447e5353

$pseditor.EditorServicesVersion :
Major  Minor  Build  Revision
-----  -----  -----  --------
1      4      1      0

code --list-extensions --show-versions
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]

$PSVersionTable
Name                           Value
----                           -----
PSVersion                      5.1.14393.1770
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.14393.1770
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Issue Description

This is a pretty minor but very annoying issue. When I press F5 to start debugging the focus seems to shift to the integrated console which seems to capture all key presses so if the script is stopped on a breakpoint I have to click into the code window to be able to step through the code. As I said very minor but really annoying issue.

@ajansveld
Copy link

F8 also does this, but have you tried putting this in your user settings? Works for me!
"powershell.integratedConsole.focusConsoleOnExecute": false

@daviwil
Copy link
Contributor

daviwil commented Oct 25, 2017

Thanks @ajansveld! This is correct, you need to change this setting to control the focus behavior.

@daviwil daviwil closed this as completed Oct 25, 2017
@hvl71
Copy link

hvl71 commented Feb 16, 2018

Thanks @daviwil and @ajansveld. As a new user of Visual Studio Code I found this behaviour confusing. I thought it was a bug and it impacted the way I perceived the product. Probably many other users expect F5 etc to behave like in Visual Studio etc. I don't know if this is the right place, but I'd suggest the default behaviour is changed to "powershell.integratedConsole.focusConsoleOnExecute": false, so especially new users don't have to Google or adjust settings. As a new user I wasn't even aware I could set settings at such detailed level..:-) Still have a lot to learn about this very very cool edtior!

@TylerLeonhardt
Copy link
Member

Well, the reason F5 moves to the console is because F5 is supposed to start debugging.

When you run F5, you shouldn't really be changing the code (generally speaking) because you're debugging your script - people are more likely to run something in the integrated terminal to debug something at a particular breakpoint.

Again, generally speaking.

That said, if a lot (majority) of people would rather have this setting default to false, we're happy to change that 😀

@daviwil
Copy link
Contributor

daviwil commented Feb 16, 2018

The default can't be changed due to accessibility requirements. When you take an action that causes text to be written in a different pane, the focus/cursor is supposed to move to that pane. @tylerl0706 if you want to know more, talk to Keith Bankston, he's the one who asked me to make the change to begin with.

@rkeithhill
Copy link
Contributor

FWIW this used to bug me too because the console ate F10/F11 so stepping stopped working for me until I put the focus back in editor. That issue is now fixed in VSCode 1.20. The terminal now passes the common debug F keys through to the debugger.

@TylerLeonhardt
Copy link
Member

@daviwil that makes perfect sense. Thanks for the info

@hvl71
Copy link

hvl71 commented Feb 16, 2018

I couldn't solve my issue by setting this user setting (as previously mentioned on this issue):
"powershell.integratedConsole.focusConsoleOnExecute": false

I think it's because I'm on Ubuntu and instead hits this issue:
#1119

I'm on VSCode 1.20.1 and Powershell Extension 1.51.

So it looks like those affected like me just have to wait for 1.52. Any info on when that is estimated to be released?

@TylerLeonhardt
Copy link
Member

1.6.0 will be released next week 🎉

@hvl71
Copy link

hvl71 commented Feb 17, 2018

Fantastic! looking forward to that! Thanks!

I was curious if I'd see the same issue on Windows, so I installed VSCode 1.20.1 and Powershell Extension 1.51. It worked like a charm..:-)

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

No branches or pull requests

6 participants