Problem#
On Windows, T3 Code reads PATH, FNM_DIR and FNM_MULTISHELL_PATH from PowerShell at startup, in the desktop app and in the server. PowerShell writes redirected output in the console code page (850 on a German system, 437 on a US one), and both probes decode it as UTF-8. Every non-ASCII character comes back as U+FFFD:
| Value in the environment | What the probe returns |
|---|
C:\Users\Jürgen\Grüße | C:\Users\J�rgen\Gr��e |
For a Windows account such as Jürgen, the directories the probe adds to PATH do not exist, and the fnm variables point nowhere. Tools that are reachable only through those entries are reported as not found.
Change#
Both probe scripts set [Console]::OutputEncoding to UTF-8 without a BOM before they write. The statement sits in a try/catch, so a host that cannot change its console encoding behaves as it does today.
The change is in two files because the desktop app has its own copy of the probe script (DesktopShellEnvironment.ts) next to the shared one (packages/shared/src/shell.ts).
Scope#
Small fix of an obvious bug, so there is no issue. #25801 fixed the same kind of decoding problem for az output.
#35702 edits the same two files for a different problem (carriage returns) and does not touch the encoding.
Verification#
Windows 11, German system locale, console code page 850, with C:\Users\Jürgen\Grüße in an environment variable:
| Shell | Without the change | With the change |
|---|
PowerShell 7 (pwsh.exe) | C:\Users\J�rgen\Gr��e | C:\Users\Jürgen\Grüße |
Windows PowerShell 5.1 (powershell.exe) | C:\Users\J�rgen\Gr��e | C:\Users\Jürgen\Grüße |
Unit tests:
packages/shared/src/shell.test.ts, "reads a non-ASCII value from the real shell": runs the real probe on Windows. It fails without the change with C:\Users\J�rgen\Gr��e and passes with it. Skipped on other platforms.
packages/shared/src/shell.test.ts, "asks PowerShell for UTF-8 output": runs on every platform and checks the script the probe sends.
apps/desktop/src/shell/DesktopShellEnvironment.test.ts, "asks PowerShell for UTF-8 output on Windows": fails without the change and passes with it; the file's 28 tests pass. Run on Linux, because this test file fails on my Windows machine with and without the change (its temp directory resolves to undefined\temp).
Not checked. The packaged desktop app under a Windows account with a non-ASCII name.
Drafted with Claude Fable 5.2 in T3 Code; found by Claude Opus 5.5. The tests and the PowerShell runs are from my own machines.
Evidence#
Windows Server 2025, Windows PowerShell 5.1, code page 437; real Electron app, fresh isolated state, light theme, identical 1100×780 viewport.
C:\Users\Jürgen\Grüße\codex.cmdprintingcodex-cli 0.130.0, and prepend its directory through the PowerShell profile.Reproduction driver, fixture, launcher, and recording scripts · Fixture encoding transcript
Not shown: