Allow selected code execution through CNTRL+ENTER when script editor is not focused #8500
Replies: 2 comments
-
You can probably get this to work! I'm not sure about taking Ctrl+Enter since a lot of commands are bound to that, and the executeCode command puts focus back in the source editor. Try something like this: a custom keybinding that executes code and then puts focus back in the Console afterwards by string together two commands with {
"key": "ctrl+k e",
"command": "runCommands",
"args": {
"commands": [
"workbench.action.positronConsole.executeCode",
"workbench.action.positronConsole.focusConsole"
]
}
} https://code.visualstudio.com/docs/configure/keybindings#_running-multiple-commands |
Beta Was this translation helpful? Give feedback.
-
@jmcphers Works, thanks! Only confusing thing remaining was that it doesn't work when putting it on certain key combinations, I presume because those are already taken by others though I thought this file should override previous shortcuts. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I'm trying to make code selection execution (CNTRL+ENTER) work also when the focus is not on the script editor window, similar to how it works in RSTudio.
This is the relevant default keybinding:
I have changed it to the following, but this unfortunately does not work:
Would this be possible in some other way? Or does it require changes in the Positron codebase? Thanks!
Beta Was this translation helpful? Give feedback.
All reactions