Garbled output / not setting dumb terminal mode with shell snapshot on

Resolved 💬 3 comments Opened Nov 18, 2025 by Nek-12 Closed Mar 29, 2026

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 build with 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

  1. From the CLI, ask Codex to run git log or git merge.
  2. Observe that the transcript captures the full pager/editor session with ANSI control characters.
  3. Alternatively, run ./scripts/deploy-prod.sh which triggers a docker 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.

View original on GitHub ↗

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