@@ -54,6 +54,7 @@ import { URI } from 'vscode-uri';
54
54
import { MonacoEditor } from '@theia/monaco/lib/browser/monaco-editor' ;
55
55
import { TerminalFrontendContribution } from '@theia/terminal/lib/browser/terminal-frontend-contribution' ;
56
56
import { QuickOpenWorkspace } from '@theia/workspace/lib/browser/quick-open-workspace' ;
57
+ import { TerminalService } from '@theia/terminal/lib/browser/base/terminal-service' ;
57
58
58
59
export namespace VscodeCommands {
59
60
export const OPEN : Command = {
@@ -93,6 +94,8 @@ export class PluginVscodeCommandsContribution implements CommandContribution {
93
94
protected readonly terminalContribution : TerminalFrontendContribution ;
94
95
@inject ( QuickOpenWorkspace )
95
96
protected readonly quickOpenWorkspace : QuickOpenWorkspace ;
97
+ @inject ( TerminalService )
98
+ protected readonly terminalService : TerminalService ;
96
99
97
100
registerCommands ( commands : CommandRegistry ) : void {
98
101
commands . registerCommand ( VscodeCommands . OPEN , {
@@ -584,5 +587,35 @@ export class PluginVscodeCommandsContribution implements CommandContribution {
584
587
} , {
585
588
execute : ( ) => commands . executeCommand ( WorkspaceCommands . NEW_FOLDER . id )
586
589
} ) ;
590
+ commands . registerCommand ( {
591
+ id : 'workbench.action.terminal.sendSequence'
592
+ } , {
593
+ execute : ( args ?: { text ?: string } ) => {
594
+ if ( args === undefined || args . text === undefined ) {
595
+ return ;
596
+ }
597
+
598
+ const currentTerminal = this . terminalService . currentTerminal ;
599
+
600
+ if ( currentTerminal === undefined ) {
601
+ return ;
602
+ }
603
+
604
+ currentTerminal . sendText ( args . text ) ;
605
+ }
606
+ } ) ;
607
+ commands . registerCommand ( {
608
+ id : 'workbench.action.terminal.kill'
609
+ } , {
610
+ execute : ( ) => {
611
+ const currentTerminal = this . terminalService . currentTerminal ;
612
+
613
+ if ( currentTerminal === undefined ) {
614
+ return ;
615
+ }
616
+
617
+ currentTerminal . dispose ( ) ;
618
+ }
619
+ } ) ;
587
620
}
588
621
}
0 commit comments