Skip to content

Commit e2a9394

Browse files
committed
No longer restore backuped folders and workspaces. For microsoft#92467
1 parent 80cd0ee commit e2a9394

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

src/vs/platform/windows/electron-main/windowsMainService.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -452,16 +452,12 @@ export class WindowsMainService extends Disposable implements IWindowsMainServic
452452
}
453453

454454
//
455-
// These are windows to restore because of hot-exit or from previous session (only performed once on startup!)
455+
// These are windows to restore because of hot-exit or from previous session that would otherwise be lost (only performed once on startup!)
456456
//
457-
let foldersToRestore: URI[] = [];
458457
let workspacesToRestore: IWorkspacePathToOpen[] = [];
459458
if (openConfig.initialStartup && !openConfig.cli.extensionDevelopmentPath && !openConfig.cli['disable-restore-windows']) {
460-
let foldersToRestore = this.backupMainService.getFolderBackupPaths();
461-
foldersToOpen.push(...foldersToRestore.map(f => ({ folderUri: f, remoteAuhority: getRemoteAuthority(f) })));
462-
463459
// collect from workspaces with hot-exit backups and from previous window session
464-
workspacesToRestore = [...this.backupMainService.getWorkspaceBackups(), ...this.workspacesMainService.getUntitledWorkspacesSync()];
460+
workspacesToRestore = this.workspacesMainService.getUntitledWorkspacesSync();
465461
workspacesToOpen.push(...workspacesToRestore);
466462

467463
emptyToRestore.push(...this.backupMainService.getEmptyWindowBackupPaths());
@@ -495,7 +491,6 @@ export class WindowsMainService extends Disposable implements IWindowsMainServic
495491
const usedWindow = usedWindows[i];
496492
if (
497493
(usedWindow.openedWorkspace && workspacesToRestore.some(workspace => usedWindow.openedWorkspace && workspace.workspace.id === usedWindow.openedWorkspace.id)) || // skip over restored workspace
498-
(usedWindow.openedFolderUri && foldersToRestore.some(uri => isEqual(uri, usedWindow.openedFolderUri))) || // skip over restored folder
499494
(usedWindow.backupPath && emptyToRestore.some(empty => usedWindow.backupPath && empty.backupFolder === basename(usedWindow.backupPath))) // skip over restored empty window
500495
) {
501496
continue;

0 commit comments

Comments
 (0)