Skip to content

Commit

Permalink
Escape {} properly in bash terminal (#150933)
Browse files Browse the repository at this point in the history
Fixes #150774
  • Loading branch information
roblourens committed Jun 1, 2022
1 parent 133a177 commit 399916e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/vs/workbench/contrib/debug/node/terminals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ export function prepareCommand(shell: string, args: string[], cwd?: string, env?
case ShellType.bash: {

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

Expand Down
2 changes: 1 addition & 1 deletion src/vs/workbench/contrib/debug/test/node/terminals.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ suite('Debug - prepareCommand', () => {
test('bash', () => {
assert.strictEqual(
prepareCommand('bash', ['{$} (']).trim(),
'{\\$}\\ \\(');
'\\{\\$\\}\\ \\(');
assert.strictEqual(
prepareCommand('bash', ['hello', 'world', '--flag=true']).trim(),
'hello world --flag=true');
Expand Down

0 comments on commit 399916e

Please sign in to comment.