12

I keep pressing shift + enter in VSCode by accident and it brings up the terminal, is there a way to disable this shortcut?

1

3 Answers 3

13

Open the shortcuts settings on vscode (either from "settings", or with "Ctrl + K, Ctrl + S") and search which shortcut you have assigned to "Shift Enter".

You can enter "Shift Enter" directly in the search box to see those.

Then edit or delete those you don't want

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks, this is specially frustrating when using VIM keybindings in python files
I'm a bit upset that this was the default for executing code via two key presses.
0

If you prefer to set this in your user keybindings.json file, you can add these lines:

 { "key": "shift+enter", "command": "-python.execSelectionInTerminal", "when": "editorTextFocus && !findInputFocussed && !isCompositeNotebook && !jupyter.ownsSelection && !notebookEditorFocused && !replaceInputFocussed && editorLangId == 'python'" }, 

Footnote:

The way I constructed this was to find the offending keybinding using this answer, change the keybinding to some other key, look at what was produced in my keybindings.json file, and then remove the "some other key" binding, leaving only the subtractive (-) version of the command.

Comments

-3

On Visual Studio 2019 with default settings, go to:

Tools > Options > Environment > Keyboard.

Under "Show commmands containing:", type: Edit.SmartBreakLine

Then click Remove [Shortcut].

--

THEN, do same for "InteractiveConsole.BreakLine", and again remove the Shift+Enter shortcut.

Side effect on InteractiveConsole.BreakLine: After removing the shortcut, If you keep holding shift + enter to type a normal new line after removing InteractiveConsole.BreakLine, (without getting auto-complete-stuff), you won't get a new line.

1 Comment

The question is about Visual Studio Code.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.