Skip to content
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
87cb42c
Avoid OS state changes in portable mode
dmitrivMS Jan 11, 2026
537d40d
Merge remote-tracking branch 'origin/main' into dev/dmitriv/portable-fix
dmitrivMS Jan 12, 2026
a039f9d
Merge remote-tracking branch 'origin/main' into dev/dmitriv/portable-fix
dmitrivMS Jan 12, 2026
88e874f
Merge branch 'main' into dev/dmitriv/portable-fix
dmitrivMS Jan 12, 2026
4311fc8
Merge branch 'main' into dev/dmitriv/portable-fix
dmitrivMS Jan 13, 2026
60b89d8
Merge branch 'main' into dev/dmitriv/portable-fix
dmitrivMS Jan 17, 2026
2990a16
Merge remote-tracking branch 'origin/main' into dev/dmitriv/portable-fix
dmitrivMS Jan 18, 2026
ec08a89
Fix GitHub authentication in portable mode by skipping protocol handl…
dmitrivMS Jan 18, 2026
e5d59a2
Merge branch 'main' into dev/dmitriv/portable-fix
dmitrivMS Jan 18, 2026
f63f874
PR feedback
dmitrivMS Jan 18, 2026
4ec6dea
Merge branch 'main' into dev/dmitriv/portable-fix
dmitrivMS Jan 18, 2026
2a9eb60
Fix extension tests
dmitrivMS Jan 18, 2026
f64f43c
Merge branch 'main' into dev/dmitriv/portable-fix
dmitrivMS Jan 19, 2026
3e79f79
Merge branch 'main' into dev/dmitriv/portable-fix
dmitrivMS Jan 20, 2026
f81b52e
Merge branch 'main' into dev/dmitriv/portable-fix
dmitrivMS Jan 20, 2026
815a5eb
Merge branch 'main' into dev/dmitriv/portable-fix
dmitrivMS Jan 20, 2026
c0b9067
Merge branch 'main' into dev/dmitriv/portable-fix
dmitrivMS Jan 21, 2026
1207961
Merge branch 'main' into dev/dmitriv/portable-fix
dmitrivMS Jan 21, 2026
587db57
Merge branch 'main' into dev/dmitriv/portable-fix
dmitrivMS Jan 21, 2026
2943ff2
Merge branch 'main' into dev/dmitriv/portable-fix
dmitrivMS Jan 21, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export interface IEnvironmentMainService extends INativeEnvironmentService {

// --- config
readonly disableUpdates: boolean;
readonly isPortable: boolean;

// TODO@deepak1556 temporary until a real fix lands upstream
readonly enableRDPDisplayTracking: boolean;
Expand All @@ -56,6 +57,9 @@ export class EnvironmentMainService extends NativeEnvironmentService implements
@memoize
get disableUpdates(): boolean { return !!this.args['disable-updates']; }

@memoize
get isPortable(): boolean { return !!process.env['VSCODE_PORTABLE']; }

@memoize
get crossOriginIsolated(): boolean { return !!this.args['enable-coi']; }

Expand Down
4 changes: 3 additions & 1 deletion src/vs/platform/url/electron-main/electronUrlListener.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ export class ElectronURLListener extends Disposable {
}

// Windows: install as protocol handler
if (isWindows) {
// Skip in portable mode: the registered command wouldn't preserve
// portable mode settings, causing issues with OAuth flows
if (isWindows && !environmentMainService.isPortable) {
const windowsParameters = environmentMainService.isBuilt ? [] : [`"${environmentMainService.appRoot}"`];
windowsParameters.push('--open-url', '--');
app.setAsDefaultProtocolClient(productService.urlProtocol, process.execPath, windowsParameters);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { IWorkspaceIdentifier, WORKSPACE_EXTENSION } from '../../workspace/commo
import { IWorkspacesManagementMainService } from './workspacesManagementMainService.js';
import { ResourceMap } from '../../../base/common/map.js';
import { IDialogMainService } from '../../dialogs/electron-main/dialogMainService.js';
import { IEnvironmentMainService } from '../../environment/electron-main/environmentMainService.js';

export const IWorkspacesHistoryMainService = createDecorator<IWorkspacesHistoryMainService>('workspacesHistoryMainService');

Expand Down Expand Up @@ -56,7 +57,8 @@ export class WorkspacesHistoryMainService extends Disposable implements IWorkspa
@IWorkspacesManagementMainService private readonly workspacesManagementMainService: IWorkspacesManagementMainService,
@ILifecycleMainService private readonly lifecycleMainService: ILifecycleMainService,
@IApplicationStorageMainService private readonly applicationStorageMainService: IApplicationStorageMainService,
@IDialogMainService private readonly dialogMainService: IDialogMainService
@IDialogMainService private readonly dialogMainService: IDialogMainService,
@IEnvironmentMainService private readonly environmentMainService: IEnvironmentMainService
) {
super();

Expand Down Expand Up @@ -104,7 +106,8 @@ export class WorkspacesHistoryMainService extends Disposable implements IWorkspa
files.push(recent);

// Add to recent documents (Windows only, macOS later)
if (isWindows && recent.fileUri.scheme === Schemas.file) {
// Skip in portable mode to avoid leaving traces on the machine
if (isWindows && recent.fileUri.scheme === Schemas.file && !this.environmentMainService.isPortable) {
app.addRecentDocument(recent.fileUri.fsPath);
}
}
Expand All @@ -127,7 +130,8 @@ export class WorkspacesHistoryMainService extends Disposable implements IWorkspa
this._onDidChangeRecentlyOpened.fire();

// Schedule update to recent documents on macOS dock
if (isMacintosh) {
// Skip in portable mode to avoid leaving traces on the machine
if (isMacintosh && !this.environmentMainService.isPortable) {
this.macOSRecentDocumentsUpdater.trigger(() => this.updateMacOSRecentDocuments());
}
}
Expand All @@ -153,7 +157,8 @@ export class WorkspacesHistoryMainService extends Disposable implements IWorkspa
this._onDidChangeRecentlyOpened.fire();

// Schedule update to recent documents on macOS dock
if (isMacintosh) {
// Skip in portable mode to avoid leaving traces on the machine
if (isMacintosh && !this.environmentMainService.isPortable) {
this.macOSRecentDocumentsUpdater.trigger(() => this.updateMacOSRecentDocuments());
}
}
Expand All @@ -178,7 +183,11 @@ export class WorkspacesHistoryMainService extends Disposable implements IWorkspa
}

await this.saveRecentlyOpened({ workspaces: [], files: [] });
app.clearRecentDocuments();

// Skip in portable mode to avoid leaving traces on the machine
if (!this.environmentMainService.isPortable) {
app.clearRecentDocuments();
}

// Event
this._onDidChangeRecentlyOpened.fire();
Expand Down Expand Up @@ -311,6 +320,11 @@ export class WorkspacesHistoryMainService extends Disposable implements IWorkspa
return; // only on windows
}

// Skip in portable mode to avoid leaving traces on the machine
if (this.environmentMainService.isPortable) {
return;
}

await this.updateWindowsJumpList();
this._register(this.onDidChangeRecentlyOpened(() => this.updateWindowsJumpList()));
}
Expand Down
Loading