@@ -1317,6 +1317,14 @@ export class WindowsMainService extends Disposable implements IWindowsMainServic
1317
1317
private async openInBrowserWindow ( options : IOpenBrowserWindowOptions ) : Promise < ICodeWindow > {
1318
1318
const windowConfig = this . configurationService . getValue < IWindowSettings | undefined > ( 'window' ) ;
1319
1319
1320
+ let window : ICodeWindow | undefined ;
1321
+ if ( ! options . forceNewWindow && ! options . forceNewTabbedWindow ) {
1322
+ window = options . windowToUse || this . getLastActiveWindow ( ) ;
1323
+ if ( window ) {
1324
+ window . focus ( ) ;
1325
+ }
1326
+ }
1327
+
1320
1328
// Build up the window configuration from provided options, config and environment
1321
1329
const configuration : INativeWindowConfiguration = {
1322
1330
@@ -1342,7 +1350,7 @@ export class WindowsMainService extends Disposable implements IWindowsMainServic
1342
1350
1343
1351
profiles : {
1344
1352
all : this . userDataProfilesMainService . profiles ,
1345
- profile : await this . resolveProfileForBrowserWindow ( options )
1353
+ profile : window ?. isExtensionDevelopmentHost && window ?. profile ? window . profile : await this . resolveProfileForBrowserWindow ( options )
1346
1354
} ,
1347
1355
1348
1356
homeDir : this . environmentMainService . userHome . fsPath ,
@@ -1375,14 +1383,6 @@ export class WindowsMainService extends Disposable implements IWindowsMainServic
1375
1383
continueOn : this . environmentMainService . continueOn ,
1376
1384
} ;
1377
1385
1378
- let window : ICodeWindow | undefined ;
1379
- if ( ! options . forceNewWindow && ! options . forceNewTabbedWindow ) {
1380
- window = options . windowToUse || this . getLastActiveWindow ( ) ;
1381
- if ( window ) {
1382
- window . focus ( ) ;
1383
- }
1384
- }
1385
-
1386
1386
// New window
1387
1387
if ( ! window ) {
1388
1388
const state = this . windowsStateHandler . getNewWindowState ( configuration ) ;
@@ -1512,7 +1512,9 @@ export class WindowsMainService extends Disposable implements IWindowsMainServic
1512
1512
}
1513
1513
}
1514
1514
if ( profile ) {
1515
- this . userDataProfilesMainService . setProfileForWorkspaceSync ( options . workspace ?? 'empty-window' , profile ) ;
1515
+ if ( ! options . cli ?. extensionDevelopmentPath ) {
1516
+ this . userDataProfilesMainService . setProfileForWorkspaceSync ( options . workspace ?? 'empty-window' , profile ) ;
1517
+ }
1516
1518
} else {
1517
1519
profile = this . userDataProfilesMainService . getOrSetProfileForWorkspace ( options . workspace ?? 'empty-window' , ( options . windowToUse ?? this . getLastActiveWindow ( ) ) ?. profile ?? this . userDataProfilesMainService . defaultProfile ) ;
1518
1520
}
0 commit comments