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
[Windows] Console windows flash during shell execution with hooks enabled; disabling hooks avoids the issue #48826
Update: The console window flashing appears to be related to hooks.
I retested in fresh sessions using the same working directory and
the same prompt asking Codex to print the current directory.
With hooks enabled, separate console windows briefly appeared
and disappeared.
With codex --disable hooks, the flashing did not occur.
This suggests that hooks being enabled is a relevant trigger.
My original comparison between 0.157.1 and 0.155.1 should not be
treated as confirmation of a version-specific regression.
Disabling hooks is a workaround in my environment. I have not yet
isolated whether the cause is a specific configured hook or
Codex's hook execution handling.
What version of Codex CLI is running?
0.157.1
What subscription do you have?
pro
Which model were you using?
gpt 6.0 astra
What platform is your computer?
window
What terminal emulator and version are you using (if applicable)?
No response
Codex doctor report
What issue are you seeing?
On Windows, Codex CLI 0.157.1 repeatedly opens and closes separate
console windows when executing shell commands. This interrupts
other desktop work.
What steps can reproduce the bug?
Launch Codex CLI 0.157.1 from PowerShell.
Ask Codex to run a shell command, such as printing the current directory.
Observe a separate console window briefly appear and disappear.
changed the title [-][Windows] Console windows flash during shell execution in 0.157.1; does not occur in 0.155.1[/-][+][Windows] Console windows flash during shell execution with hooks enabled; disabling hooks avoids the issue[/+]on Sep 28, 2026
Root cause found. codex-rs/hooks/src/engine/command_runner.rs spawns hook commands on Windows via JobObject::spawn_contained, which calls JobObject::prepare_suspended_spawn in codex-rs/utils/pty/src/win/job.rs:
This only ever sets CREATE_SUSPENDED — it never sets CREATE_NO_WINDOW, on either the successful containment path or the two failure-fallback sites (command_runner.rs:231, and the equivalent in codex-rs/git-utils/src/git_process.rs) that reset creation_flags(0). Since Command::creation_flags on Windows replaces rather than combines flags, every hook command (and git subprocess) launched through this path has lacked console-window suppression, which matches --disable hooks working around it here.
This is distinct from #48483, which correctly added CREATE_NO_WINDOW as the default for codex_utils_pty::Command — but that only covers the PTY/exec path, not this second, independent JobObject::prepare_suspended_spawn used by the hooks and git-utils crates.
Fix (compiles clean via cargo check -p codex-utils-pty -p codex-hooks -p codex-git-utils): OR in CREATE_NO_WINDOW alongside CREATE_SUSPENDED in the shared prepare_suspended_spawn, and fix the two fallback sites to clear only CREATE_SUSPENDED instead of zeroing all flags.
I can't open a PR directly (external PR creation appears restricted on this repo), but the fix is up on my fork if a maintainer wants to pull it in: ScienHAC@b51e128
This same root cause likely also explains the git.exe-flashing reports in other open duplicates (e.g. #24910, #48356), since git-utils shares the identical fallback pattern.
Reacted by jgsjss9854, Piyush Sharma and Bruno Couri
Activity
github-actions commentedon Sep 28, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
etraut-openai commentedon Sep 28, 2026
Thanks for the bug report. We understand the problem and will have it fixed in the next release.
[-][Windows] Console windows flash during shell execution in 0.157.1; does not occur in 0.155.1[/-][+][Windows] Console windows flash during shell execution with hooks enabled; disabling hooks avoids the issue[/+]ScienHAC commentedon Sep 28, 2026
Root cause found.
codex-rs/hooks/src/engine/command_runner.rsspawns hook commands on Windows viaJobObject::spawn_contained, which callsJobObject::prepare_suspended_spawnincodex-rs/utils/pty/src/win/job.rs:This only ever sets
CREATE_SUSPENDED— it never setsCREATE_NO_WINDOW, on either the successful containment path or the two failure-fallback sites (command_runner.rs:231, and the equivalent incodex-rs/git-utils/src/git_process.rs) that resetcreation_flags(0). SinceCommand::creation_flagson Windows replaces rather than combines flags, every hook command (and git subprocess) launched through this path has lacked console-window suppression, which matches--disable hooksworking around it here.This is distinct from
#48483, which correctly addedCREATE_NO_WINDOWas the default forcodex_utils_pty::Command— but that only covers the PTY/exec path, not this second, independentJobObject::prepare_suspended_spawnused by the hooks and git-utils crates.Fix (compiles clean via
cargo check -p codex-utils-pty -p codex-hooks -p codex-git-utils): OR inCREATE_NO_WINDOWalongsideCREATE_SUSPENDEDin the sharedprepare_suspended_spawn, and fix the two fallback sites to clear onlyCREATE_SUSPENDEDinstead of zeroing all flags.I can't open a PR directly (external PR creation appears restricted on this repo), but the fix is up on my fork if a maintainer wants to pull it in: ScienHAC@b51e128
This same root cause likely also explains the git.exe-flashing reports in other open duplicates (e.g. #24910, #48356), since
git-utilsshares the identical fallback pattern.ScienHAC commentedon Sep 28, 2026
Please fix it Asap!!
etraut-openai commentedon Sep 29, 2026
We're tracking this in #48074, and we're working on a fix.