Search code examples
visual-studio-codeautosave

What is the difference between "onFocusChange" and "onWindowsChange" in VSCode?


VSCode enables the following options for files.autoSave:

  1. onFocusChange
  2. onWindowsChange

Each having the following description:

  1. A dirty editor is automatically saved when the editor loses focus.
  2. A dirty editor is automatically saved when the window loses focus.

What is the difference between the two? When does the editor lose focus and when does the window do that?


Solution

  • onFocusChange auto-saves files both when you switch windows on your computer AND when you switch tabs within VSCode.

    onWindowChange auto-saves files only when you switch windows on your computer.