What would you like to be added?
On Windows, the CLI currently defaults to powershell.exe (v5.1) for run_shell_command. This creates a bottleneck
because:
- Encoding Issues: Native PowerShell defaults to GBK (936), causing encoding mismatches/mojibake when modern tools
(like eza, lsd, or git) output UTF-8.
- Limited Modern Features: Many users have migrated to pwsh (v7+) or NuShell for better performance and
cross-platform compatibility.
- Environment Isolation: Users often have their dev environment set up in pwsh, but the CLI executes commands in a
different, unconfigured environment.
Desired outcome: Add a setting (e.g., tools.shell.executablePath) to allow users to specify their preferred shell
executable.
Why is this needed?
Unlocks Modern Windows Tooling & Fixes Encoding by Design
- UTF-8 First: The legacy powershell.exe defaults to legacy encodings (GBK/CP936), causing mojibake with almost
all modern CLI tools (Rust-based tools like eza, ripgrep, or even Node/Python scripts). Configuring the shell to pwsh
(which handles UTF-8 correctly by default) fixes this natively without hacky $PROFILE modifications.
- User Preference & Consistency: Developers invest time configuring their shell (pwsh, nu, bash) with specific
aliases, environment variables, and tools. Forcing execution in a raw powershell.exe environment breaks this
consistency and limits the CLI's potential integration with the user's workflow.
Additional context
📋 原始测试日志 (Raw Test Logs)
TEST 1: PowerShell 7 (pwsh) [Profile Enabled] <<<
Active code page: 65001
.
鈹溾攢鈹€ 鍙傝€冭祫鏂
鈹溾攢鈹€ 瀹炰範鏂囨。
鈹溾攢鈹€ 宸ョ▼鏂囦欢
鈹斺攢鈹€ 杞欢宸ュ叿
TEST 2: Windows PowerShell (powershell) [Profile Enabled] <<<
Active code page: 65001
.
鈹溾攢鈹€ 鍙傝€冭祫鏂
鈹溾攢鈹€ 瀹炰範鏂囨。
鈹溾攢鈹€ 宸ョ▼鏂囦欢
鈹斺攢鈹€ 杞欢宸ュ叿
TEST 3: NuShell (nu) <<<
.
鈹溾攢鈹€ 鍙傝€冭祫鏂
鈹溾攢鈹€ 瀹炰範鏂囨。
鈹溾攢鈹€ 宸ョ▼鏂囦欢
鈹斺攢鈹€ 杞欢宸ュ叿
TEST 4: CMD (cmd) <<<
Active code page: 65001
.
鈹溾攢鈹€ 鍙傝€冭祫鏂
鈹溾攢鈹€ 瀹炰範鏂囨。
鈹溾攢鈹€ 宸ョ▼鏂囦欢
鈹斺攢鈹€ 杞欢宸ュ叿
Technical Observations:
-
Brittle Encoding Management: As shown in the logs, even after manually forcing the code page to 65001 (UTF-8) via
$PROFILE modifications, modern tools like eza still produce mojibake (broken characters) when piped through the
hardcoded powershell.exe session used by the CLI agent. This demonstrates that simply "patching" the legacy shell is
not a robust solution.
-
Shell Inconsistency: While NuShell (Test 3) handles these characters natively and correctly, it must be manually
invoked as a sub-process of powershell.exe, leading to unnecessary overhead and potential environment variable loss.
-
The Hidden Bottleneck: The native powershell.exe (v5.1) is an outdated execution host for AI agents. By
hardcoding it, the CLI prevents users from leveraging the native UTF-8 handling and modern features of pwsh or nu,
which are standard in modern Windows development workflows.
Conclusion: Allowing a configurable shell path would allow the CLI to use a modern shell host directly, eliminating
these encoding artifacts and aligning with the user's actual development environment.
What would you like to be added?
On Windows, the CLI currently defaults to powershell.exe (v5.1) for run_shell_command. This creates a bottleneck
because:
(like eza, lsd, or git) output UTF-8.
cross-platform compatibility.
different, unconfigured environment.
Desired outcome: Add a setting (e.g., tools.shell.executablePath) to allow users to specify their preferred shell
executable.
Why is this needed?
Unlocks Modern Windows Tooling & Fixes Encoding by Design
all modern CLI tools (Rust-based tools like eza, ripgrep, or even Node/Python scripts). Configuring the shell to pwsh
(which handles UTF-8 correctly by default) fixes this natively without hacky $PROFILE modifications.
aliases, environment variables, and tools. Forcing execution in a raw powershell.exe environment breaks this
consistency and limits the CLI's potential integration with the user's workflow.
Additional context
📋 原始测试日志 (Raw Test Logs)
Technical Observations:
Brittle Encoding Management: As shown in the logs, even after manually forcing the code page to 65001 (UTF-8) via
$PROFILE modifications, modern tools like eza still produce mojibake (broken characters) when piped through the
hardcoded powershell.exe session used by the CLI agent. This demonstrates that simply "patching" the legacy shell is
not a robust solution.
Shell Inconsistency: While NuShell (Test 3) handles these characters natively and correctly, it must be manually
invoked as a sub-process of powershell.exe, leading to unnecessary overhead and potential environment variable loss.
The Hidden Bottleneck: The native powershell.exe (v5.1) is an outdated execution host for AI agents. By
hardcoding it, the CLI prevents users from leveraging the native UTF-8 handling and modern features of pwsh or nu,
which are standard in modern Windows development workflows.
Conclusion: Allowing a configurable shell path would allow the CLI to use a modern shell host directly, eliminating
these encoding artifacts and aligning with the user's actual development environment.