Windows: Codex launches PowerShell with corrupted HOME path when username contains "é" (USERPROFILE/APPDATA can also be affected)
What version of the Codex App are you using (From “About Codex” dialog)?
26.325.31654
What subscription do you have?
Enterprise
What platform is your computer?
Microsoft Windows NT 10.0.26200.0 x64
What issue are you seeing?
Summary
On Windows, Codex desktop appears to launch pwsh with a corrupted HOME value when the Windows username contains a non-ASCII character (é in my case).
This causes PowerShell's built-in $HOME / ~ to initialize incorrectly inside the Codex terminal, even though the same PowerShell installation works correctly in Windows Terminal outside Codex.
In my environment, the username is:
rugé
But inside Codex, PowerShell starts with:
C:\Users\rug�
or sometimes mojibake variants like:
C:\Users\rugé
What I expected
Codex should launch PowerShell with the same correct home/profile path that Windows Terminal uses:
C:\Users\rugé
What happens instead
Inside Codex:
$HOMEis wrong~resolves incorrectly- tools that rely on
$HOMEor paths derived from it may break - Codex logs also show malformed paths like:
C:\Users\rug�\.ssh\config
Outside Codex, in Windows Terminal:
- PowerShell resolves
$HOMEcorrectly - scripts and profile paths work normally
Important detail
This appears to happen before the PowerShell profile runs.
I was able to fix profile-driven issues like APPDATA, LOCALAPPDATA, Terminal-Icons, UTF-8 settings, and optional module imports in my profile, but I could not fix PowerShell's built-in $HOME because that is initialized before the profile runs.
That suggests Codex itself is passing a bad HOME environment variable into pwsh at launch.
Environment
- Codex desktop app
- Windows 10.0.26200
- PowerShell 7.6.0
- Host:
ConsoleHost - User identity:
AzureAD\\rugé - Time observed: March 30, 2026
What steps can reproduce the bug?
Repro steps
- Use Windows with a user profile containing a non-ASCII character in the username, for example
é. - Open Codex desktop.
- Start a PowerShell terminal in Codex.
- Run:
\\\powershell\
$HOME
$env:HOME
$env:USERPROFILE
$env:APPDATA
\\
Actual result
In Codex, $HOME is initialized incorrectly, for example:
\\\powershell\
$HOME
C:\Users\rug�
\\
while other values may differ or require manual correction in profile code.
What is the expected behavior?
Expected result
All of these should resolve consistently to the correct Windows user path, for example:
\\\powershell\
C:\Users\rugé
\\
Additional information
Additional observations
- Windows shell folder registry values were correct.
- User-level
HOMEinHKCU:\Environmentwas correct. - PowerShell worked correctly outside Codex.
- Codex had also created/used package-state directories under malformed user-profile paths.
- Codex logs showed malformed path usage before shell profile code executed.
Workarounds
Current workaround is to avoid ~ / $HOME in Codex PowerShell sessions and use:
$env:USERPROFILE[Environment]::GetFolderPath('UserProfile')
instead.
I also patched my PowerShell profile to:
- guard optional imports (
Terminal-Icons,oh-my-posh,Microsoft.WinGet.CommandNotFound) - force UTF-8 consistently
- rebuild
APPDATA/LOCALAPPDATAfrom the canonical user profile path
That removes the visible startup errors, but does not fix the initial bad $HOME value created by Codex.
Possible cause
Codex may be:
- mis-encoding the Windows user profile path before spawning
pwsh, or - populating
HOMEfrom an incorrectly decoded value, especially for non-ASCII usernames.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗