@@ -139,6 +139,7 @@ export class UserDataProfilesWorkbenchContribution extends Disposable implements
139
139
this . _register ( this . registerSwitchProfileAction ( ) ) ;
140
140
141
141
this . registerOpenProfileSubMenu ( ) ;
142
+ this . registerNewWindowWithProfileAction ( ) ;
142
143
this . registerProfilesActions ( ) ;
143
144
this . _register ( this . userDataProfilesService . onDidChangeProfiles ( ( ) => this . registerProfilesActions ( ) ) ) ;
144
145
@@ -235,6 +236,39 @@ export class UserDataProfilesWorkbenchContribution extends Disposable implements
235
236
} ) ;
236
237
}
237
238
239
+ private registerNewWindowWithProfileAction ( ) : IDisposable {
240
+ return registerAction2 ( class NewWindowWithProfileAction extends Action2 {
241
+ constructor ( ) {
242
+ super ( {
243
+ id : `workbench.profiles.actions.newWindowWithProfile` ,
244
+ title : localize2 ( 'newWindowWithProfile' , "New Window with Profile..." ) ,
245
+ category : PROFILES_CATEGORY ,
246
+ precondition : HAS_PROFILES_CONTEXT ,
247
+ f1 : true ,
248
+ } ) ;
249
+ }
250
+ async run ( accessor : ServicesAccessor ) {
251
+ const quickInputService = accessor . get ( IQuickInputService ) ;
252
+ const userDataProfilesService = accessor . get ( IUserDataProfilesService ) ;
253
+ const hostService = accessor . get ( IHostService ) ;
254
+
255
+ const pick = await quickInputService . pick (
256
+ userDataProfilesService . profiles . map ( profile => ( {
257
+ label : profile . name ,
258
+ profile
259
+ } ) ) ,
260
+ {
261
+ title : localize ( 'new window with profile' , "New Window with Profile" ) ,
262
+ placeHolder : localize ( 'pick profile' , "Select Profile" ) ,
263
+ canPickMany : false
264
+ } ) ;
265
+ if ( pick ) {
266
+ return hostService . openWindow ( { remoteAuthority : null , forceProfile : pick . profile . name } ) ;
267
+ }
268
+ }
269
+ } ) ;
270
+ }
271
+
238
272
private registerNewWindowAction ( profile : IUserDataProfile ) : IDisposable {
239
273
const disposables = new DisposableStore ( ) ;
240
274
0 commit comments