Change:
I know I suggested but after trying it out I am convinced that was a wrong suggestion. I think we should just revert it, and whenever we open a new folder it should be using the CURRENT profile. I know and feel the same.
Lets discuss this!
Actually I liked this behaviour too. Reverted this after our discussion. Bringing this back again :)
Awesome - thanks!
Is it possible to associate a workspace (or folder) with a profile? E.g. can I set that if I open a workspace (or folder) "A", current profile will be switched to "Default" and if I open a workspace "B", current profile will be switched to "Work"?
Well, it seems to be already working:

Discussion:
private async openInBrowserWindow(options: IOpenBrowserWindowOptions): Promise<ICodeWindow> { const windowConfig = this.configurationService.getValue<IWindowSettings | undefined>('window'); <ins> const lastActiveWindow = this.getLastActiveWindow(); const defaultProfile = lastActiveWindow?.profile ?? this.userDataProfilesMainService.defaultProfile; </ins> let window: ICodeWindow | undefined; if (!options.forceNewWindow && !options.forceNewTabbedWindow) { <del> window = options.windowToUse || this.getLastActiveWindow(); </del> <ins> window = options.windowToUse || lastActiveWindow; </ins> if (window) { window.focus(); }

// Set to default profile first and resolve and update the profile // only after the workspace-backup is registered. // Because, workspace identifier of an empty window is known only then. <del> profile: this.userDataProfilesMainService.defaultProfile </del> <ins> profile: defaultProfile </ins> }, homeDir: this.environmentMainService.userHome.fsPath,

if (window.isReady) { this.lifecycleMainService.unload(window, UnloadReason.LOAD).then(async veto => { if (!veto) { <del> await this.doOpenInBrowserWindow(window!, configuration, options); </del> <ins> await this.doOpenInBrowserWindow(window!, configuration, options, defaultProfile); </ins> } }); } else { <del> await this.doOpenInBrowserWindow(window, configuration, options); </del> <ins> await this.doOpenInBrowserWindow(window, configuration, options, defaultProfile); </ins> } return window; } <del> private async doOpenInBrowserWindow(window: ICodeWindow, configuration: INativeWindowConfiguration, options: IOpenBrowserWindowOptions): Promise<void> { </del> <ins> private async doOpenInBrowserWindow(window: ICodeWindow, configuration: INativeWindowConfiguration, options: IOpenBrowserWindowOptions, defaultProfile: IUserDataProfile): Promise<void> { </ins> // Register window for backups unless the window // is for extension development, where we do not

if (this.userDataProfilesMainService.isEnabled()) { const workspace = configuration.workspace ?? toWorkspaceIdentifier(configuration.backupPath, false); <del> const profilePromise = this.resolveProfileForBrowserWindow(options, workspace); </del> <ins> const profilePromise = this.resolveProfileForBrowserWindow(options, workspace, defaultProfile); </ins> const profile = profilePromise instanceof Promise ? await profilePromise : profilePromise; configuration.profiles.profile = profile;

window.load(configuration); } <del> private resolveProfileForBrowserWindow(options: IOpenBrowserWindowOptions, workspace: IAnyWorkspaceIdentifier): Promise<IUserDataProfile> | IUserDataProfile { </del> <ins> private resolveProfileForBrowserWindow(options: IOpenBrowserWindowOptions, workspace: IAnyWorkspaceIdentifier, defaultProfile: IUserDataProfile): Promise<IUserDataProfile> | IUserDataProfile { </ins> if (options.forceProfile) { return this.userDataProfilesMainService.profiles.find(p => p.name === options.forceProfile) ?? this.userDataProfilesMainService.createNamedProfile(options.forceProfile); }

return this.userDataProfilesMainService.createTransientProfile(); } <del> return this.userDataProfilesMainService.getProfileForWorkspace(workspace) ?? this.userDataProfilesMainService.defaultProfile; </del> <ins> return this.userDataProfilesMainService.getProfileForWorkspace(workspace) ?? defaultProfile; </ins> } private onWindowClosed(window: ICodeWindow): void {