According to the comment here: https://github.com/Microsoft/vscode/issues/50671 it’s possible to edit this behavior in the keybindings, but provides no instructions for how to do so.
How do I edit the VScode keybindings so that if I press CTRL+W with no open tabs, it doesn’t close the editor? It’s highly annoying to be trying to close a bunch of tabs and then accidentally close the entire editor.
Answer
Go to File -> Preferences -> Keyboard Shortcuts (or press Ctrl+K Ctrl+S).
Find the “Close Window” setting with Ctrl+W as the Keybinding.
Right click and remove the key binding or edit it to another combination.
Attribution
Source : Link , Question Author : Our_Benefactors , Answer Author : Ryan Grange