On VSCode, when using #%% cells, shift-enter no longer executes a cell in the interactive window and moves to the next cell. It used to work for many years, but now shift-enter on some line of code throws an error in a new window titled ‘Python REPL’. I can still use control-enter to execute a cell in the interactive window, but that does not move the cursor to the next cell. Could a VSCode update have changed the short-cut functionality?
Question posted in Visual Studio Code
View the official documentation.
View the official documentation.
2
Answers
I tried using
shift-enter
in the new version of vscode, which executes cells in an interactive window. You can try updating your vscode version, or open the shortcut settings by typing the commandPreferences: Open Keyboard Shortcuts
in the command palette. You can check if theShift-Enter
shortcut settings have changed, or create a new shortcut for executing cells in the interactive window. You can learn more about the shortcut settings in the document.Step 1:
Open Settings (Ctrl + .) and search for
python.repl
. Then disable:python.REPL: Send to Native REPL
Step 2: Open keybindings.json by pressing
Ctrl + Shift + P
> Search forkeyboard
> SelectPreferences: Open Keyboard Shortcuts (JSON)
. Add or changeshift + enter
if already present:This
when
condition is copied frompython.execInRepl
command’s keyboard shortcut which is taking overShift + Enter