From f3f203d36ccd125cec486f0f4867451868801ee9 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Wed, 29 Apr 2026 19:15:59 +0800 Subject: [PATCH] fix: wrap cmd in subshell to fix ::set-teamsfx-env on Linux with semicolons (#15818) Agent-Logs-Url: https://github.com/OfficeDev/microsoft-365-agents-toolkit/sessions/683cfd15-3d39-49f4-9572-c914fb161e1c Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: qfai <9050812+qfai@users.noreply.github.com> --- packages/vscode-ui/src/ui.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/vscode-ui/src/ui.ts b/packages/vscode-ui/src/ui.ts index e5a880eea0e..31f1ad180be 100644 --- a/packages/vscode-ui/src/ui.ts +++ b/packages/vscode-ui/src/ui.ts @@ -1147,7 +1147,7 @@ export class VSCodeUI implements UserInteraction { // Bash script for Unix-like systems // Use tee inside the script to display output in the terminal while capturing to file, // then exit with the command's actual exit code via PIPESTATUS. - scriptContent = `#!/bin/bash\nset +e\n${cmd} 2>&1 | tee "${tempFile}"\nexit \${PIPESTATUS[0]}\n`; + scriptContent = `#!/bin/bash\nset +e\n( ${cmd} ) 2>&1 | tee "${tempFile}"\nexit \${PIPESTATUS[0]}\n`; wrappedCmd = `bash "${scriptFile}"`; }