File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
src/vs/workbench/contrib/debug/node Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -222,13 +222,26 @@ export class ExecutableDebugAdapter extends StreamDebugAdapter {
222
222
throw new Error ( nls . localize ( 'unableToLaunchDebugAdapterNoArgs' , "Unable to launch debug adapter." ) ) ;
223
223
}
224
224
} else {
225
+ let spawnCommand = command ;
226
+ let spawnArgs = args ;
225
227
const spawnOptions : cp . SpawnOptions = {
226
228
env : env
227
229
} ;
228
230
if ( options . cwd ) {
229
231
spawnOptions . cwd = options . cwd ;
230
232
}
231
- this . serverProcess = cp . spawn ( command , args , spawnOptions ) ;
233
+ if ( platform . isWindows && ( command . endsWith ( '.bat' ) || command . endsWith ( '.cmd' ) ) ) {
234
+ // https://github.com/microsoft/vscode/issues/224184
235
+ spawnOptions . shell = true ;
236
+ spawnCommand = `"${ command } "` ;
237
+ spawnArgs = args . map ( a => {
238
+ a = a . replace ( / " / g, '\\"' ) ; // Escape existing double quotes with \
239
+ // Wrap in double quotes
240
+ return `"${ a } "` ;
241
+ } ) ;
242
+ }
243
+
244
+ this . serverProcess = cp . spawn ( spawnCommand , spawnArgs , spawnOptions ) ;
232
245
}
233
246
234
247
this . serverProcess . on ( 'error' , err => {
You can’t perform that action at this time.
0 commit comments