Skip to content

Commit 292d51f

Browse files
committed
only use hardQuote for env variables
1 parent 1b1815a commit 292d51f

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,6 @@ export function prepareCommand(args: DebugProtocol.RunInTerminalRequestArguments
320320
}
321321

322322
let quote: (s: string) => string;
323-
let hardQuote: (s: string) => string;
324323
let command = '';
325324

326325
switch (shellType) {
@@ -392,12 +391,12 @@ export function prepareCommand(args: DebugProtocol.RunInTerminalRequestArguments
392391
return (s.indexOf(' ') >= 0 || s.indexOf('\\') >= 0) ? `"${s}"` : s;
393392
};
394393

395-
hardQuote = (s: string) => {
394+
const hardQuote = (s: string) => {
396395
return /[^\w@%\/+=,.:^-]/.test(s) ? `'${s.replace(/'/g, '\'\\\'\'')}'` : s;
397396
};
398397

399398
if (args.cwd) {
400-
command += `cd ${hardQuote(args.cwd)} && `;
399+
command += `cd ${quote(args.cwd)} && `;
401400
}
402401
if (args.env) {
403402
command += 'env';

0 commit comments

Comments
 (0)