When I started using VSCode in 2018, we had no option for being warned before quitting the terminal.
This was extremely annoying when we accidentally pressed cmd + Q or cmd + W and instantly closed the code editor.
I found an extension called "Quit Control for VSCode" that implemented this control, which I have been using until today.
But "Today I Learned" that VSCode had implemented that feature in 2022 (took longer than I expected 🤷♂️).
To enable it, open your user settings, search for confirm before close, and mark it as always.
Now, if you try quite VSCode, a native pop-up will appears like this: