fix(shell): escape ! for cmd.exe delayed expansion

Adds defensive escaping for exclamation marks in case delayed
expansion is enabled in the user's cmd.exe environment.
This commit is contained in:
kaitranntt
2026-02-05 10:45:07 -05:00
parent 48aa3cca30
commit 61bc54af05
2 changed files with 6 additions and 0 deletions
+5
View File
@@ -75,5 +75,10 @@ describe('escapeShellArg', () => {
const { escapeShellArg } = await import('../../../src/utils/shell-executor');
expect(escapeShellArg('C:\\Program Files\\App')).toBe('"C:\\Program Files\\App"');
});
it('escapes exclamation marks for delayed expansion', async () => {
const { escapeShellArg } = await import('../../../src/utils/shell-executor');
expect(escapeShellArg('hello!')).toBe('"hello^^!"');
});
});
});