Windows/WSL: PowerShell system32 prompt appears during active Codex CLI session
Open 💬 6 comments Opened May 19, 2026 by KRADIFY
💡 Likely answer: A maintainer (github-actions[bot], contributor)
responded on this thread — see the highlighted reply below.
What version of the Codex App are you using (From “About Codex” dialog)?
19-05-2026 update
What subscription do you have?
Pay as you Go
What platform is your computer?
Microsoft Windows NT 10.0.26200.0 x64
What issue are you seeing?
Environnement :
- Windows + WSL
- Projet lancé depuis E:\Marie AN 2026
Symptôme :
- Codex démarre normalement et travaille dans le bon dossier : /mnt/e/Marie AN 2026
- Au bout d’un moment, sans action utilisateur dans PowerShell, le prompt Windows réapparaît dans l’interface :
PS C:\WINDOWS\system32>
- Des fragments de texte destinés au chat Codex sont alors envoyés dans PowerShell, par exemple ession, qui provoque :
Le terme «ession» n'est pas reconnu...
- La session Codex continue partiellement, mais le routage clavier/terminal devient instable.
Indices :
- Le lanceur existant fonctionnait avant la mise à jour du matin.
- Codex affiche parfois 1 background terminal running · /ps to view · /stop to close.
- Le log TUI montre des refresh/reconnexions fréquents et un échec de refresh plugin 403 Forbidden côté chatgpt.com.
- Le problème n’est pas lié au dossier projet ni aux scripts RNE/OpenFisca : aucun process métier actif n’explique le
retour à system32.
Workaround testé/proposé :
- Lancer Codex avec :
--no-alt-screen --disable terminal_resize_reflow --disable plugins --disable plugin_hooks
- Objectif : éviter le reflow terminal expérimental et le refresh plugin pendant le diagnostic.
Ce serait à poster dans le forum Codex ou à envoyer au support avec le fichier log :
C:\Users\Jean-Christophe\.codex\log\codex-tui.log
Le point important à remonter : ce n’est pas un mauvais working directory au démarrage ; c’est une fuite/réapparition
du terminal PowerShell parent pendant une session Codex déjà active.
What steps can reproduce the bug?
- codex-cli 0.131.0
- Windows + WSL
- le symptôme PS C:\WINDOWS\system32> pendant une session active
- le fait que codex doctor signale WebSocket/reachability
- extrait du log C:\Users\Jean-Christophe\.codex\log\codex-tui.log
What is the expected behavior?
_No response_
Additional information
_No response_
6 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
In fact codex is running properly but without any manual intervention it
switches to system32 and close the codex session. It's just beginning
today. Perhaps after the update ?
Codex has written me a "stable" launcher : [launcher stable] Codex sans
alt-screen, sans terminal reflow experimental, sans plugins. It seems
better but it crashed at one time.
Best regards,
Jean-Christophe Niquet
Le mar. 19 mai 2026 à 17:51, Keesan @.***> a écrit :
--
Cordialement,
Jean-Christophe NIQUET
07 68 57 27 21
I m a new bee don't know how starring an answer ?
Thanks, that extra detail helps.
If it starts in the right cwd and only later snaps back to
system32and kills the session, I would instrument the reattach/focus-transfer path rather than the launcher path. A tiny receipt every time ownership changes would probably make this much easier to isolate:reattach,helper-exit,focus-restore, etc.)That would separate "helper window exists" from "helper reclaimed input", which sound similar from the outside but are very different bugs.
And on the star question: if you ever want to star a repo on GitHub, the
Starbutton is in the top-right of the repo page. No pressure though; the repro details are the genuinely useful part here.Dear,
Last night Codex had a brutal crisis with the supposed "stable" launcher,
repeatedly windows 32 killing the session one minute after beginning to
work in a codex session.
I will try to log the problem and send you.
Best regards,
Jean-Christophe
Le mar. 19 mai 2026 à 18:33, Keesan @.***> a écrit :
--
Cordialement,
Jean-Christophe NIQUET
07 68 57 27 21
Hey, I’ve been hitting this too from time to time. For me it mostly happened when an agent tried to SSH into a server and SSH fell back to a password prompt.
I finally got a deterministic repro on Windows:
exec_commandwithttyomitted:Ctrl+Cgets control back.I can reproduce it both inside a terminal multiplexer like herdr and directly in Windows Terminal, so the multiplexer doesn’t seem involved. The same SSH prompt works correctly when the command uses
tty: true: it stays inside the background terminal and Codex keeps its input.It looks like Windows non-TTY children still inherit Codex’s parent console. The non-TTY pipe path redirects stdio, but only detaches from the controlling terminal on Unix. That lets Windows OpenSSH use the parent
CONIN$/CONOUT$directly and bypass the tool capture.The likely fix seems to be starting Windows non-TTY children without the parent console (
CREATE_NO_WINDOW/ the existingConsoleMode::NoWindowpath), while keeping the current ConPTY behavior fortty: true.Gonna try this in my fork and edit the conclusion here once I know whether it actually fixes it.
Update
I ended up (hopefully) fixing the core issue in PR #85 by detaching Windows non-TTY child processes from Codex’s console.
While testing that, I figured it also made sense to guard the console-input recovery path so an unexpected console change can’t leave Codex stuck waiting forever. That follow-up is in PR #86.
Retested the merged release build with the exact command above: no prompt leaked into the composer and keyboard input remained responsive. I also tested with
tty: true; the password prompt correctly stayed inside the background terminal.Looks fixed on my end. I’ll keep running the fork and update this if it happens again.
Happy to provide more info/diagnosis for someone fixing this for real.