Skip to content

Commit 399916e

Browse files
authored
Escape {} properly in bash terminal (microsoft#150933)
Fixes microsoft#150774
1 parent 133a177 commit 399916e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ export function prepareCommand(shell: string, args: string[], cwd?: string, env?
161161
case ShellType.bash: {
162162

163163
quote = (s: string) => {
164-
s = s.replace(/(["'\\\$!><#()\[\]*&^| ;])/g, '\\$1');
164+
s = s.replace(/(["'\\\$!><#()\[\]*&^| ;{}`])/g, '\\$1');
165165
return s.length === 0 ? `""` : s;
166166
};
167167

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ suite('Debug - prepareCommand', () => {
1111
test('bash', () => {
1212
assert.strictEqual(
1313
prepareCommand('bash', ['{$} (']).trim(),
14-
'{\\$}\\ \\(');
14+
'\\{\\$\\}\\ \\(');
1515
assert.strictEqual(
1616
prepareCommand('bash', ['hello', 'world', '--flag=true']).trim(),
1717
'hello world --flag=true');

0 commit comments

Comments
 (0)