Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to prevent Visual Studio Code from exiting when pressing Ctrl+W and no editor is open

Pressing Ctrl+W closes the active editor window. When no more editors are open, Ctrl+W terminates VSCode. Could not find a related setting.

To me this is unexpected. Is it easy to prevent this?

Just realized that Ctrl+W is "close Window" while Ctrl+F4 is "close editor". Maybe I should just use the close editor command.

like image 466
citykid Avatar asked Jan 06 '18 15:01

citykid


1 Answers

{
    "key": "ctrl+w",
    "command": "-workbench.action.closeWindow",
    "when": "!editorIsOpen && !multipleEditorGroups"
},

Minus stands for "remove keybinding".

like image 64
Alex Avatar answered Oct 20 '22 00:10

Alex