@@ -47,6 +47,7 @@ export function activate(context: vscode.ExtensionContext): void {
4747 vscode . commands . registerCommand ( 'ev3devBrowser.deviceTreeItem.disconnect' , d => d . disconnect ( ) ) ,
4848 vscode . commands . registerCommand ( 'ev3devBrowser.deviceTreeItem.select' , d => d . handleClick ( ) ) ,
4949 vscode . commands . registerCommand ( 'ev3devBrowser.fileTreeItem.run' , f => f . run ( ) ) ,
50+ vscode . commands . registerCommand ( 'ev3devBrowser.fileTreeItem.runInTerminal' , f => f . runInTerminal ( ) ) ,
5051 vscode . commands . registerCommand ( 'ev3devBrowser.fileTreeItem.delete' , f => f . delete ( ) ) ,
5152 vscode . commands . registerCommand ( 'ev3devBrowser.fileTreeItem.showInfo' , f => f . showInfo ( ) ) ,
5253 vscode . commands . registerCommand ( 'ev3devBrowser.fileTreeItem.upload' , f => f . upload ( ) ) ,
@@ -843,9 +844,18 @@ class File extends vscode.TreeItem {
843844 label : 'Run' ,
844845 description : this . path
845846 } ;
846- vscode . window . showQuickPick ( [ runItem ] ) . then ( value => {
847- if ( value === runItem ) {
848- this . run ( ) ;
847+ const runInTerminalItem = < vscode . QuickPickItem > {
848+ label : 'Run in interactive terminal' ,
849+ description : this . path
850+ } ;
851+ vscode . window . showQuickPick ( [ runItem , runInTerminalItem ] ) . then ( value => {
852+ switch ( value ) {
853+ case runItem :
854+ this . run ( ) ;
855+ break ;
856+ case runInTerminalItem :
857+ this . runInTerminal ( ) ;
858+ break ;
849859 }
850860 } ) ;
851861 }
@@ -857,7 +867,19 @@ class File extends vscode.TreeItem {
857867 name : 'Run' ,
858868 request : 'launch' ,
859869 program : this . path ,
860- download : false
870+ download : false ,
871+ interactiveTerminal : false ,
872+ } ) ;
873+ }
874+
875+ public runInTerminal ( ) : void {
876+ vscode . debug . startDebugging ( undefined , < vscode . DebugConfiguration > {
877+ type : 'ev3devBrowser' ,
878+ name : 'Run in interactive terminal' ,
879+ request : 'launch' ,
880+ program : this . path ,
881+ download : false ,
882+ interactiveTerminal : true ,
861883 } ) ;
862884 }
863885
0 commit comments