Garbled output / not setting dumb terminal mode with shell snapshot on
What version of Codex is running?
0.58.0
What subscription do you have?
pro
Which model were you using?
5.1-codex
What platform is your computer?
Darwin 25.1.0 arm64 arm
What issue are you seeing?
Summary
When Codex executes commands that produce interactive/TUI output (git log with pager, git merge invoking $EDITOR, docker build with live progress, etc.),
the recorded transcript in the CLI gets flooded with raw ANSI escape sequences (e.g., ``, cursor moves, color codes). This makes the conversation log almost
unreadable and drowns out the actual information.
Environment
- Codex CLI harness (on macOS ARM64, zsh shell)
- Commands triggered via
bash -lc '<cmd>'in workspace-write sandbox - Typical offenders:
git log(default pager),git merge(opens Vim),docker buildwith BuildKit’s fancy progress, deployment scripts that pipe colorful output, gradle commands.
What steps can reproduce the bug?
Uploaded thread: 019a98e8-43e5-7ca0-9c44-bb7d5c60f796
Steps to Reproduce
- From the CLI, ask Codex to run
git logorgit merge. - Observe that the transcript captures the full pager/editor session with ANSI control characters.
- Alternatively, run
./scripts/deploy-prod.shwhich triggers adocker build+docker push. The log shows repeated escape sequences and partial redraws.
What is the expected behavior?
Expected Behavior
The transcript should contain clean, line-based output suitable for review—no control sequences, no half-drawn TUI frames. Ideally:
- Git commands run with
GIT_PAGER=cat/--no-pager,GIT_EDITOR=true,--no-edit. - Docker BuildKit progress rendered in plain mode (
DOCKER_BUILDKIT_PROGRESS=plain). - Other tools respect
NO_COLOR/TERM=dumb.
Actual Behavior
Raw escape characters and cursor-control codes spill into the transcript, making it hard to read and wasting bandwidth/storage.
Additional information
Proposed Fix / Ideas
- Allow configuring default env vars for Codex commands (per project or session) so we can force
NO_COLOR=1,TERM=dumb,DOCKER_BUILDKIT_PROGRESS=plain,
GIT_PAGER=cat, etc.
- Alternatively, have Codex automatically detect interactive commands and add
--no-pager/--no-edit/ plain output flags unless explicitly overridden. - Provide a lightweight wrapper script (e.g.,
.codexrc) that Codex sources before running commands, isolating it from the user’s shell environment.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗