@@ -58,6 +58,7 @@ define(function (require, exports, module) {
5858 const CMD_TERMINAL_COPY = "terminal.copy" ;
5959 const CMD_TERMINAL_PASTE = "terminal.paste" ;
6060 const CMD_TERMINAL_SELECT_ALL = "terminal.selectAll" ;
61+ const CMD_TERMINAL_KILL = "terminal.kill" ;
6162 const CMD_TERMINAL_CLEAR = "terminal.clear" ;
6263 const TERMINAL_CONTEXT_MENU_ID = "terminal-context-menu" ;
6364 const PANEL_ID = "terminal-panel" ;
@@ -109,7 +110,7 @@ define(function (require, exports, module) {
109110 function _createPanel ( ) {
110111 const templateVars = {
111112 Strings : {
112- CMD_NEW_TERMINAL : "New Terminal" ,
113+ CMD_NEW_TERMINAL : Strings . CMD_NEW_TERMINAL ,
113114 TERMINAL_CLEAR : "Clear" ,
114115 TERMINAL_KILL : "Kill" ,
115116 CMD_HIDE_TERMINAL : "Close Panel"
@@ -578,7 +579,7 @@ define(function (require, exports, module) {
578579 }
579580
580581 $item . append ( $ ( '<span class="terminal-flyout-close"></span>' )
581- . attr ( "title" , Strings . TERMINAL_CLOSE_TAB_TOOLTIP )
582+ . attr ( "title" , Strings . CMD_KILL_TERMINAL )
582583 . append ( '<i class="fa-solid fa-xmark"></i>' ) ) ;
583584 $item . append ( '<span class="terminal-flyout-icon"><i class="fa-solid fa-terminal"></i></span>' ) ;
584585 $item . append ( $ ( '<span class="terminal-flyout-title"></span>' ) . text ( label ) ) ;
@@ -822,7 +823,7 @@ define(function (require, exports, module) {
822823 }
823824
824825 // Register commands
825- CommandManager . register ( "New Terminal" , CMD_NEW_TERMINAL , _createNewTerminal , { supportsDesignMode : true } ) ;
826+ CommandManager . register ( Strings . CMD_NEW_TERMINAL , CMD_NEW_TERMINAL , _createNewTerminal , { supportsDesignMode : true } ) ;
826827 CommandManager . register ( Strings . CMD_VIEW_TERMINAL , CMD_VIEW_TERMINAL , _showTerminal , { supportsDesignMode : true } ) ;
827828 CommandManager . register ( Strings . CMD_OPEN_IN_INTEGRATED_TERMINAL ,
828829 Commands . NAVIGATE_OPEN_IN_INTEGRATED_TERMINAL , function ( ) {
@@ -865,6 +866,12 @@ define(function (require, exports, module) {
865866 active . focus ( ) ;
866867 }
867868 } ) ;
869+ CommandManager . register ( Strings . CMD_KILL_TERMINAL , CMD_TERMINAL_KILL , function ( ) {
870+ const active = _getActiveTerminal ( ) ;
871+ if ( active ) {
872+ _closeTerminal ( active . id ) ;
873+ }
874+ } ) ;
868875 CommandManager . register ( Strings . TERMINAL_CLEAR , CMD_TERMINAL_CLEAR , function ( ) {
869876 _clearActiveTerminal ( ) ;
870877 const active = _getActiveTerminal ( ) ;
@@ -879,6 +886,9 @@ define(function (require, exports, module) {
879886 terminalContextMenu . addMenuItem ( CMD_TERMINAL_PASTE ) ;
880887 terminalContextMenu . addMenuItem ( CMD_TERMINAL_SELECT_ALL ) ;
881888 terminalContextMenu . addMenuDivider ( ) ;
889+ terminalContextMenu . addMenuItem ( CMD_NEW_TERMINAL ) ;
890+ terminalContextMenu . addMenuItem ( CMD_TERMINAL_KILL ) ;
891+ terminalContextMenu . addMenuDivider ( ) ;
882892 terminalContextMenu . addMenuItem ( CMD_TERMINAL_CLEAR ) ;
883893
884894 // Enable/disable Copy based on terminal selection
@@ -888,6 +898,7 @@ define(function (require, exports, module) {
888898 CommandManager . get ( CMD_TERMINAL_COPY ) . setEnabled ( hasSelection ) ;
889899 CommandManager . get ( CMD_TERMINAL_PASTE ) . setEnabled ( active && active . isAlive ) ;
890900 CommandManager . get ( CMD_TERMINAL_SELECT_ALL ) . setEnabled ( ! ! active ) ;
901+ CommandManager . get ( CMD_TERMINAL_KILL ) . setEnabled ( ! ! active ) ;
891902 CommandManager . get ( CMD_TERMINAL_CLEAR ) . setEnabled ( ! ! active ) ;
892903 } ) ;
893904
0 commit comments