@@ -11,6 +11,7 @@ import { IMenu, MenuId, MenuRegistry } from 'vs/platform/actions/common/actions'
11
11
import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey' ;
12
12
import { IExtensionTerminalProfile , ITerminalProfile , TerminalLocation , TerminalSettingId } from 'vs/platform/terminal/common/terminal' ;
13
13
import { ResourceContextKey } from 'vs/workbench/common/contextkeys' ;
14
+ import { TaskExecutionSupportedContext } from 'vs/workbench/contrib/tasks/common/taskService' ;
14
15
import { ICreateTerminalOptions , ITerminalLocationOptions , ITerminalService } from 'vs/workbench/contrib/terminal/browser/terminal' ;
15
16
import { TerminalCommandId , TERMINAL_VIEW_ID } from 'vs/workbench/contrib/terminal/common/terminal' ;
16
17
import { TerminalContextKeys , TerminalContextKeyStrings } from 'vs/workbench/contrib/terminal/common/terminalContextKey' ;
@@ -25,12 +26,6 @@ const enum ContextMenuGroup {
25
26
Config = '5_config'
26
27
}
27
28
28
- export const enum TerminalTabContextMenuGroup {
29
- Default = '1_create_default' ,
30
- Profile = '2_create_profile' ,
31
- Configure = '3_configure'
32
- }
33
-
34
29
export const enum TerminalMenuBarGroup {
35
30
Create = '1_create' ,
36
31
Run = '2_run' ,
@@ -334,9 +329,9 @@ export function setupTerminalMenus(): void {
334
329
item : {
335
330
command : {
336
331
id : TerminalCommandId . SelectDefaultProfile ,
337
- title : { value : localize ( 'workbench.action.terminal.selectDefaultProfile' , "Select Default Profile" ) , original : 'Select Default Profile' }
332
+ title : { value : localize ( 'workbench.action.terminal.selectDefaultProfile' , "Select Default Profile" ) , original : 'Select Default Profile' } ,
338
333
} ,
339
- group : TerminalTabContextMenuGroup . Configure
334
+ group : '3_configure'
340
335
}
341
336
} ,
342
337
{
@@ -346,8 +341,32 @@ export function setupTerminalMenus(): void {
346
341
id : TerminalCommandId . ConfigureTerminalSettings ,
347
342
title : localize ( 'workbench.action.terminal.openSettings' , "Configure Terminal Settings" )
348
343
} ,
349
- group : TerminalTabContextMenuGroup . Configure
344
+ group : '3_configure'
350
345
}
346
+ } ,
347
+ {
348
+ id : MenuId . TerminalNewDropdownContext ,
349
+ item : {
350
+ command : {
351
+ id : 'workbench.action.tasks.runTask' ,
352
+ title : localize ( 'workbench.action.tasks.runTask' , "Run Task..." )
353
+ } ,
354
+ when : TaskExecutionSupportedContext ,
355
+ group : '4_tasks' ,
356
+ order : 1
357
+ } ,
358
+ } ,
359
+ {
360
+ id : MenuId . TerminalNewDropdownContext ,
361
+ item : {
362
+ command : {
363
+ id : 'workbench.action.tasks.configureTaskRunner' ,
364
+ title : localize ( 'workbench.action.tasks.configureTaskRunner' , "Configure Tasks..." )
365
+ } ,
366
+ when : TaskExecutionSupportedContext ,
367
+ group : '4_tasks' ,
368
+ order : 2
369
+ } ,
351
370
}
352
371
]
353
372
) ;
@@ -797,15 +816,8 @@ export function getTerminalActionBarArgs(location: ITerminalLocationOptions, pro
797
816
dropdownActions . push ( new SubmenuAction ( 'split.profile' , localize ( 'splitTerminal' , 'Split Terminal' ) , submenuActions ) ) ;
798
817
dropdownActions . push ( new Separator ( ) ) ;
799
818
}
800
-
801
- for ( const [ , configureActions ] of dropdownMenu . getActions ( ) ) {
802
- for ( const action of configureActions ) {
803
- // make sure the action is a MenuItemAction
804
- if ( 'alt' in action ) {
805
- dropdownActions . push ( action ) ;
806
- }
807
- }
808
- }
819
+ const actions = dropdownMenu . getActions ( ) ;
820
+ dropdownActions . push ( ...Separator . join ( ...actions . map ( a => a [ 1 ] ) ) ) ;
809
821
810
822
const defaultSubmenuProfileAction = submenuActions . find ( d => d . label . endsWith ( '(Default)' ) ) ;
811
823
if ( defaultSubmenuProfileAction ) {
0 commit comments