To adjust VSCode’s behavior for unsaved changes and window management to avoid being prompted to save changes when closing windows, follow these configurations:
Enable auto save to automatically save changes, which helps in not being prompted when trying to close a window.
-
Open the Command Palette with
Ctrl+Shift+P(Windows/Linux) orCmd+Shift+P(Mac). -
Type
Preferences: Open Settings (UI)and select it. -
In the search bar, search for
Auto Save. -
You can choose from options like
onFocusChange,onWindowChange, orafterDelay. Select the one that best fits your workflow.
VSCode’s hot exit feature remembers unsaved changes and reopens them the next time VSCode is started.
-
In the Settings UI (accessed as above), search for
Hot Exit. -
Ensure
Hot Exitis set toonExitAndWindowCloseoronExit.
onExitAndWindowClosesaves unsaved changes and restores them even if you close just one window, whileonExitworks when exiting VSCode entirely.
To reduce interruptions from the confirmation dialog when closing a window, adjust the following:
-
Currently, there isn’t a direct setting to disable the save confirmation for each window close in the UI settings. The closest feature is utilizing the auto save and hot exit configurations.
|
Note
|
Configuring Auto Save and Hot Exit allows for a workflow where changes are either saved automatically or kept in a state where VSCode remembers them without explicitly writing to the disk. This mimics a cache-like behavior, reducing the need for save prompts on window close. Ensure you have a backup or version control system to manage changes effectively. |