@@ -233,14 +233,14 @@ class PhpDebugSession extends vscode.DebugSession {
233
233
const runtimeArgs = launchArgs . runtimeArgs || [ ] ;
234
234
const runtimeExecutable = launchArgs . runtimeExecutable || 'php' ;
235
235
const programArgs = launchArgs . args || [ ] ;
236
- const args = [ runtimeExecutable , ...runtimeArgs , launchArgs . program , ...programArgs ] ;
236
+ const args = [ ...runtimeArgs , launchArgs . program , ...programArgs ] ;
237
237
const cwd = launchArgs . cwd || process . cwd ( ) ;
238
238
const env = launchArgs . env ;
239
239
if ( launchArgs . externalConsole || launchArgs . console === 'externalTerminal' || launchArgs . console === 'integratedTerminal' ) {
240
240
// If external console or integrated terminal, send a runInTerminal request
241
241
const kind : 'integrated' | 'external' = launchArgs . externalConsole || launchArgs . console === 'externalTerminal' ? 'external' : 'integrated' ;
242
242
await new Promise < VSCodeDebugProtocol . RunInTerminalResponse > ( ( resolve , reject ) => {
243
- this . runInTerminalRequest ( { args, env, cwd, kind} , 5000 , resolve ) ;
243
+ this . runInTerminalRequest ( { args : [ runtimeExecutable , ... args ] , env, cwd, kind} , 5000 , resolve ) ;
244
244
} ) ;
245
245
} else {
246
246
// Else spawn in an "internal" console
@@ -255,6 +255,9 @@ class PhpDebugSession extends vscode.DebugSession {
255
255
script . on ( 'error' , ( error : Error ) => {
256
256
this . sendEvent ( new vscode . OutputEvent ( error . message ) ) ;
257
257
} ) ;
258
+ script . on ( 'exit' , ( code : number ) => {
259
+ this . sendEvent ( new vscode . TerminatedEvent ( ) ) ;
260
+ } ) ;
258
261
}
259
262
}
260
263
} catch ( error ) {
0 commit comments