Skip to content

Commit fd05938

Browse files
committed
properly quote empty arguments; fixes microsoft#25098
1 parent 08bb5a1 commit fd05938

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/vs/workbench/contrib/debug/node/terminals.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ export function prepareCommand(args: DebugProtocol.RunInTerminalRequestArguments
380380

381381
quote = (s: string) => {
382382
s = s.replace(/\"/g, '""');
383-
return (s.indexOf(' ') >= 0 || s.indexOf('"') >= 0) ? `"${s}"` : s;
383+
return (s.indexOf(' ') >= 0 || s.indexOf('"') >= 0 || s.length === 0) ? `"${s}"` : s;
384384
};
385385

386386
if (args.cwd) {
@@ -410,7 +410,7 @@ export function prepareCommand(args: DebugProtocol.RunInTerminalRequestArguments
410410

411411
quote = (s: string) => {
412412
s = s.replace(/([\"\\])/g, '\\$1');
413-
return s.indexOf(' ') >= 0 ? `"${s}"` : s;
413+
return (s.indexOf(' ') >= 0 || s.length === 0) ? `"${s}"` : s;
414414
};
415415

416416
const hardQuote = (s: string) => {

0 commit comments

Comments
 (0)