You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 15, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on May 15, 2026. It is now read-only.
[BUG] Windows terminal fallback incorrectly defaults to PowerShell 5.1 (Legacy) ignoring PS7 profile, causing UTF-8 encoding issues #11958
On Windows, Roo Code's background terminal execution (ExecaTerminalProcess) incorrectly falls back to legacy PowerShell 5.1 instead of the user's configured PowerShell 7 profile, causing severe UTF-8 encoding issues (mojibake).
Context (who is affected and when)
This affects Windows users who have explicitly set PowerShell 7 (pwsh.exe) as their default VS Code terminal profile, particularly when executing commands that output non-ASCII characters (e.g., Chinese) during agent tasks.
Reproduction steps
On Windows, install PowerShell 7 and set it as the default VS Code terminal profile.
Ensure Roo Code's "Disable Terminal Shell Integration" is enabled (this is the default state).
Ask Roo Code to run a command that outputs Chinese or other non-ASCII characters (e.g., echo "你好").
Expected result
Roo Code should correctly parse the VS Code terminal settings, use pwsh.exe (PowerShell 7) which natively supports UTF-8, and display the characters correctly without encoding issues.
Actual result
Roo Code incorrectly falls back to powershell.exe (PowerShell 5.1). Since it runs as a non-interactive subprocess, it ignores user $PROFILE settings (like chcp 65001) and defaults to the local system codepage (e.g., GBK), resulting in garbled text output.
Variations tried (optional)
I investigated the source code with my coding agent and found the exact root causes:
Flawed Shell Detection: In src/utils/shell.ts, getWindowsShellFromVSCode() aggressively falls back to SHELL_PATHS.POWERSHELL_LEGACY if the profile name includes "powershell" but lacks an explicit path or source === "PowerShell".
Profile Parsing Bug: In src/integrations/terminal/TerminalProcess.ts, the configuration is read incorrectly using vscode.workspace.getConfiguration("terminal.integrated.defaultProfile").get("windows"). This often returns null, forcing the legacy fallback.
(Note: I have already figured out how to fix these logic flaws and I would love to submit a PR for this if the team agrees with the findings!)
@roomote Thanks for the excellent analysis and plan! Since this would be my very first open-source contribution, I would love to implement this plan and submit the PR myself using my own coding agent.
I will reach out to Hannes on Discord for the assignment as per the contributing guidelines.
ghost added a commit that references this issue on Mar 19, 2026
PowerShell 7 (pwsh) is not installed by default on Windows. Windows comes pre-installed with Windows PowerShell 5.1 (powershell.exe). So, it's not correct to default to PowerShell 7 as some users won't have it.
Activity
3aKHP commentedon Mar 19, 2026
Claiming
@roomote Thanks for the excellent analysis and plan! Since this would be my very first open-source contribution, I would love to implement this plan and submit the PR myself using my own coding agent.
I will reach out to Hannes on Discord for the assignment as per the contributing guidelines.
fix: Windows terminal fallback defaults to PowerShell 7 instead of le…
fix: use PowerShell 7 and correct shell detection on Windows (Fixes R…
rossdonald commentedon Mar 23, 2026
Did you see this related issue? #8530
PowerShell 7 (pwsh) is not installed by default on Windows. Windows comes pre-installed with Windows PowerShell 5.1 (powershell.exe). So, it's not correct to default to PowerShell 7 as some users won't have it.