Skip to content

F8 selection on code #754

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
Graham-Beer opened this issue May 17, 2017 · 11 comments
Closed

F8 selection on code #754

Graham-Beer opened this issue May 17, 2017 · 11 comments

Comments

@Graham-Beer
Copy link

System Details

  • Operating system name and version: Windows 10 Latest version
  • VS Code version: 1.12.2
  • PowerShell extension version: 1.0
  • Output from $PSVersionTable:
    PSVersion 5.1.15063.296
    PSEdition Desktop
    PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
    BuildVersion 10.0.15063.296
    CLRVersion 4.0.30319.42000
    WSManStackVersion 3.0
    PSRemotingProtocolVersion 2.3
    SerializationVersion 1.1.0.1
Copy / paste the below commands into the PowerShell Integrated Terminal, and paste the output here

code -v
1.12.2
19222cdc84ce72202478ba1cec5cb557b71163de

$pseditor.EditorServicesVersion
Major  Minor  Build  Revision
-----  -----  -----  --------
1      0      0      0
code --list-extensions --show-versions
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]

$PSVersionTable
As Above

Issue Description

When highlighting more than one line of PowerShell code in VS Code and pressing F8, the integrated console try to run each line separately. So i have to save the code in a file and run the file from the prompt.

Attached Logs

Follow the instructions in the README
about capturing and sending logs.

@daviwil
Copy link
Contributor

daviwil commented May 17, 2017

Hey Graham, check your keybindings and see if you have F8 bound to workbench.action.terminal.runSelectedText. If so, remove that binding so that the PowerShell extension's PowerShell.RunSelection binding gets used.

@Graham-Beer
Copy link
Author

Hi David,
Thank you for getting back so quickly.

I've checked and its in the list but not bound to F8 :
// A set of command IDs whose keybindings will not be sent to the shell and instead always be handled by Code. This allows the use of keybindings that would normally be consumed by the shell to act the same as when the terminal is not focused, for example ctrl+p to launch Quick Open.
"terminal.integrated.commandsToSkipShell": [
"editor.action.toggleTabFocusMode",
"workbench.action.debug.continue",
"workbench.action.debug.pause",
"workbench.action.debug.restart",
"workbench.action.debug.run",
"workbench.action.debug.start",
"workbench.action.debug.stop",
"workbench.action.focusActiveEditorGroup",
"workbench.action.focusFirstEditorGroup",
"workbench.action.focusSecondEditorGroup",
"workbench.action.focusThirdEditorGroup",
"workbench.action.openNextRecentlyUsedEditorInGroup",
"workbench.action.openPreviousRecentlyUsedEditorInGroup",
"workbench.action.quickOpen",
"workbench.action.showCommands",
"workbench.action.terminal.clear",
"workbench.action.terminal.copySelection",
"workbench.action.terminal.focus",
"workbench.action.terminal.focusAtIndex1",
"workbench.action.terminal.focusAtIndex2",
"workbench.action.terminal.focusAtIndex3",
"workbench.action.terminal.focusAtIndex4",
"workbench.action.terminal.focusAtIndex5",
"workbench.action.terminal.focusAtIndex6",
"workbench.action.terminal.focusAtIndex7",
"workbench.action.terminal.focusAtIndex8",
"workbench.action.terminal.focusAtIndex9",
"workbench.action.terminal.focusNext",
"workbench.action.terminal.focusPrevious",
"workbench.action.terminal.kill",
"workbench.action.terminal.new",
"workbench.action.terminal.paste",
"workbench.action.terminal.runActiveFile",
"workbench.action.terminal.runSelectedText",
"workbench.action.terminal.scrollDown",
"workbench.action.terminal.scrollDownPage",
"workbench.action.terminal.scrollToBottom",
"workbench.action.terminal.scrollToTop",
"workbench.action.terminal.scrollUp",
"workbench.action.terminal.scrollUpPage",
"workbench.action.terminal.toggleTerminal"
],

@daviwil
Copy link
Contributor

daviwil commented May 17, 2017

That list comes from your user settings, it doesn't reflect your keybindings. Try opening the Keyboard Shortcuts view with File -> Preferences -> Keyboard Shortcuts and then search for F8 or workbench.action.terminal.runSelectedText.

@dfinke
Copy link
Contributor

dfinke commented May 17, 2017

Hey @Graham-Beer here's mine.

image

hth

@Graham-Beer
Copy link
Author

Hi Doug,
I have the same in mine as well. Does it matter if the source is different ?

image

@Graham-Beer
Copy link
Author

Actually I have two, one for 'user' and one for 'default'

image

@daviwil
Copy link
Contributor

daviwil commented May 17, 2017

That's the one that is causing the problem, if you remove the binding for F8 there it will start working correctly.

@Graham-Beer
Copy link
Author

For the user ?

@daviwil
Copy link
Contributor

daviwil commented May 17, 2017

Yep

@Graham-Beer
Copy link
Author

Awesome, removed the 'User' Entry and tested, working like a dream ! Thank you David and Doug for helping so quickly :)

@daviwil
Copy link
Contributor

daviwil commented May 17, 2017

No problem Graham!

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

3 participants