sessions - skip recent list in dock (#307175)

This commit is contained in:
Benjamin Pasero
2026-04-01 18:30:04 +02:00
committed by GitHub
parent 02d8ead006
commit e935227558

View File

@@ -10,7 +10,7 @@ import { Emitter, Event as CommonEvent } from '../../../base/common/event.js';
import { normalizeDriveLetter, splitRecentLabel } from '../../../base/common/labels.js';
import { Disposable } from '../../../base/common/lifecycle.js';
import { Schemas } from '../../../base/common/network.js';
import { isMacintosh, isWindows } from '../../../base/common/platform.js';
import { isMacintosh, INodeProcess, isWindows } from '../../../base/common/platform.js';
import { basename, extUriBiasedIgnorePathCase, originalFSPath } from '../../../base/common/resources.js';
import { URI } from '../../../base/common/uri.js';
import { Promises } from '../../../base/node/pfs.js';
@@ -107,7 +107,8 @@ export class WorkspacesHistoryMainService extends Disposable implements IWorkspa
// Add to recent documents (Windows only, macOS later)
// Skip in portable mode to avoid leaving traces on the machine
if (isWindows && recent.fileUri.scheme === Schemas.file && !this.environmentMainService.isPortable) {
// Skip in the sessions app to avoid polluting the jump list
if (isWindows && recent.fileUri.scheme === Schemas.file && !this.environmentMainService.isPortable && !(process as INodeProcess).isEmbeddedApp) {
app.addRecentDocument(recent.fileUri.fsPath);
}
}
@@ -325,6 +326,11 @@ export class WorkspacesHistoryMainService extends Disposable implements IWorkspa
return;
}
// Skip in the sessions app to avoid polluting the jump list
if ((process as INodeProcess).isEmbeddedApp) {
return;
}
await this.updateWindowsJumpList();
this._register(this.onDidChangeRecentlyOpened(() => this.updateWindowsJumpList()));
}
@@ -455,6 +461,11 @@ export class WorkspacesHistoryMainService extends Disposable implements IWorkspa
return;
}
// Skip in the sessions app to avoid polluting the dock
if ((process as INodeProcess).isEmbeddedApp) {
return;
}
// We clear all documents first to ensure an up-to-date view on the set. Since entries
// can get deleted on disk, this ensures that the list is always valid
app.clearRecentDocuments();