I got myself into a pickle where I had 1000 edited files open, and choosing “Close All” would prompt for “Save or discard changes” 1000 times. I’m not clicking “Don’t save” that many times. 😬
Here’s how I closed all of the Visual Studio Code editor windows without saving them:
- Add
"files.hotExit": "off",
to User Settings JSON. It tells VS Code to forget about unsaved files when you close VS Code. - Cmd-Shift-P, type “Reload window”, and hit enter.
- Click “Don’t save”
- ???
- PROFIT!
Don’t forget to undo your User Settings JSON change.
(Save all followed by git reset
wasn’t an option because it would run all auto-formatters.
Even after turning off the auto-formatters, VS Code would lock up trying to save that many files.)
Contributors: yungchar, matv, jjiang