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 }}
Repository navigation
Bash tool output shows mojibake for non-ASCII PowerShell output on Windows #543
On Windows, bash/PowerShell tool output renders with mojibake for non-ASCII text: Área de Trabalho displays as ◆rea de Trabalho (seen in directory listings under OneDrive paths). Likely a codepage/encoding mismatch when decoding the child process output (e.g. output arriving as CP1252/OEM while decoded as UTF-8, or vice versa). Expected: force or negotiate UTF-8 output (e.g. chcp 65001 / [Console]::OutputEncoding) or decode using the console's actual codepage so accented paths render correctly.
Partial coverage merged in #563 to dev-vibecoded as 502b310a07b0554de4bb96693e0ac128a75eb43f.
The PowerShell UTF-8 setup now covers the core argument builder, direct/legacy user-shell invocation and V2 Bash execution string. Exact-head Linux/Windows tests and typecheck passed, and the independent review approved that partial scope.
This issue remains open: the cmd encoding path is not covered, and actual Windows console/TUI non-ASCII output has not been verified. Aggregate Windows CI success is not that runtime proof.
Test: a file named ação-日本.txt created in a temp directory, then dir /b *.txt run through cmd.exe after the prefix <SystemRoot>\System32\chcp.com 65001>nul & , using both the argv form (Shell.args, piped stdio, windowsHide) and the spawn shell option (windowsHide). Controlled baseline: a separate child reported Active code page: 437, and an unwrapped echo was not UTF-8.
Result: both wrapped shapes exited 7 and returned stdout bytes 61 87 61 6f 2d 3f 3f 2e 74 78 74 0d 0a (CP437 bytes; 0x87 is c-cedilla, other characters became ?), not UTF-8. A fresh child still reported code page 437 afterwards. So this prefix did not make cmd emit UTF-8 in the hidden/piped path the shell tools use.
Limits: the reason is not established (a console-less hidden process is a hypothesis only); the shared-console effect on a parent was not measured; only this one prefix approach was tried. An earlier echo-based fixture was invalid (the literal accented character was already lossy before cmd ran) and is not used as evidence. This issue stays open; the cmd path needs a different, source-grounded approach.
C with chcp output visible: the child printed Active code page: 65001 twice, yet the dir bytes were still the same CP437 bytes. So in this spawn chcp ran and reported 65001; why cmd's own output did not follow it is not established.
D (nested cmd /c after the prefix): invalid probe, the nested command line was mis-quoted and cmd reported it as not recognized. Not evidence about nested cmd.
ConPTY via @lydell/node-pty default backend, same shape: dir /b exit 7 and the data string contained the name intact; type of a UTF-8 file exit 7 but the text was mojibake (CP437 reading of UTF-8 bytes). Strings, not raw wire bytes; VT sequences present.
Not shown: any fix, ConPTY with chcp 65001, mixed builtin and external producers, pipe or redirection semantics, native console behavior. #543 stays open. A follow-up probe on the ConPTY with and without chcp 65001 is queued on #678.
P1 dir /b: exit 7, the name arrives intact in the text.
P2 type of a UTF-8 file: exit 7, mojibake (CP437 reading of the UTF-8 bytes).
P3 chcp.com 65001>nul & then dir /b: output identical to P1.
P4 chcp.com 65001>nul & then type: output identical to P2, still mojibake.
So under ConPTY on this runner, the in-command chcp 65001 prefix changed neither the dir text nor the type bytes. Not shown: why, mixed builtin/external producers, other chcp placement (for example before launching the shell), pipe or redirection semantics, native console behavior. #543 stays open; no fix claim.
Activity
agenteinstinct1-max commentedon Oct 24, 2026
Partial coverage merged in #563 to dev-vibecoded as
502b310a07b0554de4bb96693e0ac128a75eb43f.The PowerShell UTF-8 setup now covers the core argument builder, direct/legacy user-shell invocation and V2 Bash execution string. Exact-head Linux/Windows tests and typecheck passed, and the independent review approved that partial scope.
This issue remains open: the cmd encoding path is not covered, and actual Windows console/TUI non-ASCII output has not been verified. Aggregate Windows CI success is not that runtime proof.
fix(shell): address chcp by absolute System32 path, never a project-r…
fix(shell): keep the chcp helper unquoted; test real cmd through Shel…
test(shell): baseline before wrapped runs, errorlevel and parent code…
test(shell): check errorlevel at run time, not at parse time (refs #543)
test(shell): probe with the absolute helper and drop the parent-conso…
test(shell): account for the cmd prefix in the bash tool test; probe …
test(shell): log each cmd spawn shape's raw output before asserting (…
test(shell): list a non-ASCII file name instead of echoing a literal …
agenteinstinct1-max commentedon Oct 27, 2026
Native Windows result for the cmd.exe path (candidate PR #665, kept unmerged). Head c01ae7e, Windows unit job https://github.com/mdev34-lab/silvercode/actions/runs/40446224732/job/121998381607.
Test: a file named
ação-日本.txtcreated in a temp directory, thendir /b *.txtrun through cmd.exe after the prefix<SystemRoot>\System32\chcp.com 65001>nul &, using both the argv form (Shell.args, piped stdio, windowsHide) and the spawnshelloption (windowsHide). Controlled baseline: a separate child reportedActive code page: 437, and an unwrapped echo was not UTF-8.Result: both wrapped shapes exited 7 and returned stdout bytes
61 87 61 6f 2d 3f 3f 2e 74 78 74 0d 0a(CP437 bytes; 0x87 is c-cedilla, other characters became?), not UTF-8. A fresh child still reported code page 437 afterwards. So this prefix did not make cmd emit UTF-8 in the hidden/piped path the shell tools use.Limits: the reason is not established (a console-less hidden process is a hypothesis only); the shared-console effect on a parent was not measured; only this one prefix approach was tried. An earlier echo-based fixture was invalid (the literal accented character was already lossy before cmd ran) and is not used as evidence. This issue stays open; the cmd path needs a different, source-grounded approach.
agenteinstinct1-max commentedon Oct 28, 2026
Bounded Windows runner results from the diagnostic draft #678 (not merged, no fix proposed), head 46c5d6a, job https://github.com/mdev34-lab/silvercode/actions/runs/40715994127/job/122913825064. Shape modeled:
Shell.args(cmd, command, cwd)(/c), piped stdio, hidden window; file namedação-日本.txt:dir /b: status 7, stdout bytes are CP437 (6187616f2d3f3f2e7478740d0a), not UTF-8.chcp.com 65001>nul &: identical bytes to A.Active code page: 65001twice, yet thedirbytes were still the same CP437 bytes. So in this spawn chcp ran and reported 65001; why cmd's own output did not follow it is not established.cmd /cafter the prefix): invalid probe, the nested command line was mis-quoted and cmd reported it as not recognized. Not evidence about nested cmd.@lydell/node-ptydefault backend, same shape:dir /bexit 7 and the data string contained the name intact;typeof a UTF-8 file exit 7 but the text was mojibake (CP437 reading of UTF-8 bytes). Strings, not raw wire bytes; VT sequences present.Not shown: any fix, ConPTY with chcp 65001, mixed builtin and external producers, pipe or redirection semantics, native console behavior. #543 stays open. A follow-up probe on the ConPTY with and without chcp 65001 is queued on #678.
agenteinstinct1-max commentedon Oct 28, 2026
ConPTY follow-up from the diagnostic draft #678 (not merged, no fix proposed), head 2149f6d, Windows job https://github.com/mdev34-lab/silvercode/actions/runs/40723534586/job/122940825132. Default
@lydell/node-ptybackend,Shell.argsshape, fileação-日本.txt, strings re-encoded as UTF-8 (not raw wire bytes), VT sequences present, every lineexit /b 7:dir /b: exit 7, the name arrives intact in the text.typeof a UTF-8 file: exit 7, mojibake (CP437 reading of the UTF-8 bytes).chcp.com 65001>nul &thendir /b: output identical to P1.chcp.com 65001>nul &thentype: output identical to P2, still mojibake.So under ConPTY on this runner, the in-command
chcp 65001prefix changed neither thedirtext nor thetypebytes. Not shown: why, mixed builtin/external producers, other chcp placement (for example before launching the shell), pipe or redirection semantics, native console behavior. #543 stays open; no fix claim.test(core): pin shell-option process settings (refs #543)
fix(shell): validate the child COMSPEC before wrapping (refs #543)
fix(shell): leave delayed expansion on the original route (refs #543)
test(shell): hold nested cmd and compare Windows spawn semantics (refs …
test(shell): surface Windows qualification in check annotations (refs #…