Windows: Codex launches PowerShell with corrupted HOME path when username contains "é" (USERPROFILE/APPDATA can also be affected)

Open 💬 2 comments Opened Mar 30, 2026 by frugecn

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:

  • $HOME is wrong
  • ~ resolves incorrectly
  • tools that rely on $HOME or 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 $HOME correctly
  • 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

  1. Use Windows with a user profile containing a non-ASCII character in the username, for example é.
  2. Open Codex desktop.
  3. Start a PowerShell terminal in Codex.
  4. 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 HOME in HKCU:\Environment was 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 / LOCALAPPDATA from 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 HOME from an incorrectly decoded value, especially for non-ASCII usernames.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗