@@ -11,6 +11,7 @@ import { IMenu, MenuId, MenuRegistry } from 'vs/platform/actions/common/actions'
1111import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey' ;
1212import { IExtensionTerminalProfile , ITerminalProfile , TerminalLocation , TerminalSettingId } from 'vs/platform/terminal/common/terminal' ;
1313import { ResourceContextKey } from 'vs/workbench/common/contextkeys' ;
14+ import { TaskExecutionSupportedContext } from 'vs/workbench/contrib/tasks/common/taskService' ;
1415import { ICreateTerminalOptions , ITerminalLocationOptions , ITerminalService } from 'vs/workbench/contrib/terminal/browser/terminal' ;
1516import { TerminalCommandId , TERMINAL_VIEW_ID } from 'vs/workbench/contrib/terminal/common/terminal' ;
1617import { TerminalContextKeys , TerminalContextKeyStrings } from 'vs/workbench/contrib/terminal/common/terminalContextKey' ;
@@ -25,12 +26,6 @@ const enum ContextMenuGroup {
2526 Config = '5_config'
2627}
2728
28- export const enum TerminalTabContextMenuGroup {
29- Default = '1_create_default' ,
30- Profile = '2_create_profile' ,
31- Configure = '3_configure'
32- }
33-
3429export const enum TerminalMenuBarGroup {
3530 Create = '1_create' ,
3631 Run = '2_run' ,
@@ -334,9 +329,9 @@ export function setupTerminalMenus(): void {
334329 item : {
335330 command : {
336331 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' } ,
338333 } ,
339- group : TerminalTabContextMenuGroup . Configure
334+ group : '3_configure'
340335 }
341336 } ,
342337 {
@@ -346,8 +341,32 @@ export function setupTerminalMenus(): void {
346341 id : TerminalCommandId . ConfigureTerminalSettings ,
347342 title : localize ( 'workbench.action.terminal.openSettings' , "Configure Terminal Settings" )
348343 } ,
349- group : TerminalTabContextMenuGroup . Configure
344+ group : '3_configure'
350345 }
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+ } ,
351370 }
352371 ]
353372 ) ;
@@ -797,15 +816,8 @@ export function getTerminalActionBarArgs(location: ITerminalLocationOptions, pro
797816 dropdownActions . push ( new SubmenuAction ( 'split.profile' , localize ( 'splitTerminal' , 'Split Terminal' ) , submenuActions ) ) ;
798817 dropdownActions . push ( new Separator ( ) ) ;
799818 }
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 ] ) ) ) ;
809821
810822 const defaultSubmenuProfileAction = submenuActions . find ( d => d . label . endsWith ( '(Default)' ) ) ;
811823 if ( defaultSubmenuProfileAction ) {
0 commit comments