Reputation: 11112
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.
Upvotes: 8
Views: 1006
Reputation: 6862
I had this issue on a new VSCode install today and was having troubles with the suggested answers I have seen.
Ultimately this was my solution
~/Library/Application Support/Code/User/settings.json
"window.closeWhenEmpty": false
Upvotes: 4
Reputation: 67749
{
"key": "ctrl+w",
"command": "-workbench.action.closeWindow",
"when": "!editorIsOpen && !multipleEditorGroups"
},
Minus stands for "remove keybinding".
Upvotes: 7