@@ -81,12 +81,10 @@ export class RunWithoutDebuggingAdapter implements vscode.DebugAdapter {
8181
8282 this . sendResponse ( request , { } ) ;
8383
84- if ( consoleMode === 'integratedTerminal' ) {
84+ if ( consoleMode === 'integratedTerminal' || consoleMode === 'internalConsole' ) {
8585 await this . launchIntegratedTerminal ( program , args , cwd , env ) ;
8686 } else if ( consoleMode === 'externalTerminal' ) {
8787 this . launchExternalTerminal ( program , args , cwd , env ) ;
88- } else {
89- this . launchInternalConsole ( program , args , cwd , env ) ;
9088 }
9189 }
9290
@@ -175,29 +173,6 @@ export class RunWithoutDebuggingAdapter implements vscode.DebugAdapter {
175173 vscode . window . showErrorMessage ( message ) ;
176174 }
177175
178- /**
179- * Spawn the process and forward stdout/stderr as DAP output events.
180- */
181- private launchInternalConsole ( program : string , args : string [ ] , cwd : string | undefined , env : NodeJS . ProcessEnv ) {
182- this . childProcess = cp . spawn ( program , args , { cwd, env } ) ;
183-
184- this . childProcess . stdout ?. on ( 'data' , ( data : Buffer ) => {
185- this . sendEvent ( 'output' , { category : 'stdout' , output : data . toString ( ) } ) ;
186- } ) ;
187- this . childProcess . stderr ?. on ( 'data' , ( data : Buffer ) => {
188- this . sendEvent ( 'output' , { category : 'stderr' , output : data . toString ( ) } ) ;
189- } ) ;
190- this . childProcess . on ( 'error' , ( err : Error ) => {
191- this . sendEvent ( 'output' , { category : 'stderr' , output : `${ err . message } \n` } ) ;
192- this . sendEvent ( 'exited' , { exitCode : 1 } ) ;
193- this . sendEvent ( 'terminated' ) ;
194- } ) ;
195- this . childProcess . on ( 'exit' , ( code : number | null ) => {
196- this . sendEvent ( 'exited' , { exitCode : code ?? 0 } ) ;
197- this . sendEvent ( 'terminated' ) ;
198- } ) ;
199- }
200-
201176 private escapeQuotes ( arg : string ) : string {
202177 return arg . replace ( / \\ / g, '\\\\' ) . replace ( / " / g, '\\"' ) ;
203178 }
0 commit comments