fix(bash): use PowerShell on Windows to capture system utility output
Windows system utilities like ipconfig, systeminfo, etc. write directly to the console via WriteConsole API instead of stdout. When Node.js spawns cmd.exe with piped stdio, these utilities produce empty output. Changes: - Switch from cmd.exe to PowerShell on Windows (properly redirects output) - Disable detached mode on Windows (PowerShell doesn't pipe stdout when detached) - Add windowsHide option to prevent console window flashing - Update tests to use PowerShell-compatible syntax (Start-Sleep, semicolons)
This commit is contained in:
1 parent
e3be5f8369
commit
b33bd6aaeb
3 files changed
+19
-9
No files matched your search
@@ -265,15 +265,17 @@ export function createBashTool(
|
||||
{
|
||||
cwd: workdir,
|
||||
env: process.env,
|
||||
detached: true,
|
||||
detached: process.platform !== "win32",
|
||||
stdio: ["pipe", "pipe", "pipe"],
|
||||
windowsHide: true,
|
||||
},
|
||||
)
|
||||
: spawn(shell, [...shellArgs, params.command], {
|
||||
cwd: workdir,
|
||||
env,
|
||||
detached: true,
|
||||
detached: process.platform !== "win32",
|
||||
stdio: ["pipe", "pipe", "pipe"],
|
||||
windowsHide: true,
|
||||
});
|
||||
|
||||
const session = {
|
||||
|
||||
Reference in new issue
Block a user