Vscode: Unsaved files are opened in two windows when reopening vscode

Created on 8 Mar 2019  路  11Comments  路  Source: microsoft/vscode

  • Open a folder
  • Create untitled file with some content
  • Quit vscode
  • Open vscode
  • Two windows are opened, one has the folder +untitled file, other is an empty window + untitled file.

So the same untitled file is opened in two windows.

bug candidate important verified workbench-hot-exit

Most helpful comment

Temporally until update is not yet, for prevent backup window add to settings "window.restoreWindows": "none"

All 11 comments

I could only repro this with an empty window:

  1. Open Code via finder
  2. Close all files/folders
  3. Open an untitled file, add changes
  4. cmd+q
  5. Open Code via finder

screen shot 2019-03-07 at 5 42 14 pm

Moving this to @aeschli as the last who touched this code.

@aeschli for some reason the emptyToRestore array has multiple entries for the same window?

Temporally until update is not yet, for prevent backup window add to settings "window.restoreWindows": "none"

When set "window.restoreWindows": "all", then every close & start VSCode will multiple windows (1 -> 2, 2 -> 4, 4 -> 6, and so on).
Fix is needed ASAP.

@aeschli this change is not in the recovery build yet pending https://github.com/Microsoft/vscode/pull/70180 right?

Pushed.

I saw this by downgrading from 1.32.2 to 1.31.1, then upgrading back. But I don't think we care about that.

@bpasero I can confirm that this issue is fixed in the latest 1.32.2 release! Thanks!

But another one what I noticed:

Steps to reproduce

  1. Open VS Code
  2. Open one existing document
  3. _Optional:_ Open a new tab or new window with a new tab and type anything and do NOT save this new file
  4. Close VS Code
  5. Re-Open VS Code
  6. Now all tabs are correctly restored!
  7. Close VS Code
  8. Open a File from Windows Explorer with right-click and open in VS Code

Expected behavior

All tabs should re-opened (Tabs/files from Step 2., 3. and 7.)

Actual behavior

Only the unsaved file from step 3. and the one from the Windows Explorer, step 7. are opened.
And the last session (int this example, file from step 1. is lost!

Is this wanted or can this be configured?

Confirm fix and also above bug with 1.32.2 and 1.32.3. Could You report this as new issue?
Now session is partially broken :-(

@SylwesterZarebski thanks. Please see #70755

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sijad picture sijad  路  3Comments

chrisdias picture chrisdias  路  3Comments

lukehoban picture lukehoban  路  3Comments

VitorLuizC picture VitorLuizC  路  3Comments

omidgolparvar picture omidgolparvar  路  3Comments