quote '$' properly; fixes #98471

This commit is contained in:
Andre Weinand 2020-05-26 14:14:31 +02:00
parent 89e9395125
commit 07a56fd95d

View file

@ -164,7 +164,7 @@ export function prepareCommand(args: DebugProtocol.RunInTerminalRequestArguments
case ShellType.bash:
quote = (s: string) => {
s = s.replace(/(["'\\])/g, '\\$1');
s = s.replace(/(["'\\\$])/g, '\\$1');
return (s.indexOf(' ') >= 0 || s.indexOf(';') >= 0 || s.length === 0) ? `"${s}"` : s;
};