Skip to content

Instantly share code, notes, and snippets.

@ninmonkey
Created March 10, 2023 21:23
Show Gist options
  • Select an option

  • Save ninmonkey/44f12fd56b316e88049ef46f1cd25060 to your computer and use it in GitHub Desktop.

Select an option

Save ninmonkey/44f12fd56b316e88049ef46f1cd25060 to your computer and use it in GitHub Desktop.
Misc VS Code Config Samples.md

2023-03-10 : Saving and Restoring Window Sessions

I almost always have multiple windows up. My config will

if I use the file -> exit menu,

  • all windows close
  • It quits without prompting for unsaved files
  • the next time I open it all windows are restored including never-saved-files

If I click X on a window to close it

  • it does prompt for any unsaved or modified files
  • it closes only that window, the rest stay open
{
    // https://code.visualstudio.com/updates/v1_59#_child-process-tracking-and-close-warnings
    "terminal.integrated.confirmOnExit": "always",
    "terminal.integrated.confirmOnExit": "hasChildProcesses",
    "terminal.integrated.confirmOnKill": "editor",
    "window.confirmBeforeClose": "keyboardOnly", // https://code.visualstudio.com/updates/v1_51#_prevent-accidental-close
    "window.newWindowDimensions": "offset",    
    "window.restoreWindows": "preserve",
}

patch notes for new settings:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment