Unified exec should suppress editor and progress output by default
What issue are you seeing?
When Codex runs shell commands through unified exec in repositories or build workflows, some common tools can still enter interactive or ANSI/progress output modes despite the existing TERM=dumb, NO_COLOR=1, and pager defaults. This can leak raw control sequences into the Codex transcript or leave commands waiting on an editor.
This is related to the previously closed report #6850 and the merged partial fix #7286. The current unified exec defaults already set PAGER=cat, GIT_PAGER=cat, and GH_PAGER=cat, but they do not currently cover editor-driven Git flows (git merge, git rebase, commit/edit prompts) or other common progress/color environment conventions.
I prepared a small branch from current main that extends the default unified exec environment and updates the existing unit test:
https://github.com/dfredriksen/codex/tree/fix/unified-exec-plain-git-env
Given the contribution policy for external PRs, I am opening this issue first rather than marking an unsolicited PR ready for review.
What steps can reproduce the bug?
Examples that can produce noisy transcript output or editor waits from a Codex shell command:
- In a git repository, run a command path that invokes an editor, such as a merge/rebase/commit flow that needs an edit message.
- Run tools that use forced color/progress output unless explicitly disabled, such as Docker BuildKit progress output.
- Observe raw cursor-control/progress escape sequences in command output or a process waiting for an interactive editor.
What is the expected behavior?
Codex tool-command transcripts should be line-oriented and reviewable by default. Non-interactive Codex command execution should avoid launching editors and should prefer plain progress/color output unless the user explicitly asks for an interactive TTY-like workflow.
Additional information
A proposed focused change is to add these defaults to UNIFIED_EXEC_ENV:
CLICOLOR=0CLICOLOR_FORCE=0EDITOR=trueVISUAL=trueGIT_EDITOR=trueGIT_SEQUENCE_EDITOR=trueGIT_MERGE_AUTOEDIT=noDOCKER_BUILDKIT_PROGRESS=plain
Local branch commit: 15ae078b50.
Local verification attempted:
cargo fmt --checkcompleted successfully, though stable rustfmt prints warnings that the repo'simports_granularity=Itemoption is nightly-only.cargo test -p codex-core unified_exec_envstarted compiling but failed locally because the machine ran out of disk space while writing Rust build artifacts (os error 112).
5 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Update: I got the repo formatter helper running locally after installing the missing helper tools.
Verification now completed:
just fmtfromcodex-rspasses end to end.Still not completed locally:
cargo test -p codex-core unified_exec_envcould not finish on this machine because the first Rust build exhausted local disk while compilingcodex-core(os error 112).I am holding off on opening a PR because
docs/contributing.mdsays external PRs are invitation-only. If this approach aligns with the maintainers' intended fix, I can open the prepared branch as a PR.Follow-up after reviewing the auto-detected related issue #22604:
jjpaging becausejjhas a tool-specificJJ_PAGERoverride.JJ_PAGER=catin the same unified exec defaults, so the prepared patch covers that open pager gap as well.Verification after the update:
just fmtfromcodex-rspasses.cargo test -p codex-core unified_exec_env --libwas attempted again, but this Windows machine still runs out of local disk while compilingcodex-coredependencies / first-party crates (os error 112).Verification update after freeing local disk space:
cargo test -p codex-core unified_exec_env --libnow passes locally.just fmtwas already passing after the branch update.So the prepared branch now has both formatter and targeted Rust test coverage passing locally.
Follow-up after testing the TUI path more directly on Windows:
The earlier unified-exec environment patch does not fully fix this issue. The failure is refresh-specific: the first TUI render can look correct, but a later refresh after startup/MCP activity can print raw ANSI escapes in a Git working tree.
The working local fix is now on the branch here:
What changed:
ENABLE_PROCESSED_OUTPUT | ENABLE_VIRTUAL_TERMINAL_PROCESSINGduring TUI mode setup on Windows.SynchronizedUpdateon non-Windows, but avoid wrapping Windows redraws with synchronized updates.Verification:
cargo fmt -- --config imports_granularity=Itempasses locally, with the existing stable-rust warning aboutimports_granularityrequiring nightly.cargo check -p codex-tuipassed locally.cargo build --locked --bin codexpassed locally.codex-fixbinary built from this commit was tested in a fresh PowerShell session insideC:\Users\Dan\Desktop\Projects\igh-planning; the refresh issue no longer reproduced there.