[Codex CLI][TUI][BUG] TUI hangs at 100% CPU when syntax-highlighting long single-line exec commands

Open 💬 0 comments Opened Jul 17, 2026 by nvax-r

What version of Codex CLI is running?

codex-cli 0.144.5

What subscription do you have?

The Codex CLI TUI can become unresponsive for more than 25 minutes while rendering an exec command containing a long, uninterrupted base64-like token. During the stall, one Codex thread consumes 100% CPU. Approvals, tool output, and keyboard interaction are not displayed. A process stack sample shows the main TUI thread spending its time inside Syntect/Oniguruma syntax highlighting, not command execution or network I/O.

Which model were you using?

gpt-5.6-sol

What platform is your computer?

Darwin 25.5.0 arm64 arm

What terminal emulator and version are you using (if applicable)?

_No response_

Codex doctor report

What issue are you seeing?

What happened

A tool call constructed a patch, encoded it as base64, and placed the encoded payload directly into a single shell command line:

printf %s <BASE64_TOKEN> | base64 -d | <command>

The two triggering command lines were:

  • 4718 bytes
  • 4700 bytes

At approximately 11:16:37, Codex emitted item/started for the first command, but the TUI became blank and unresponsive. The native Codex process remained runnable and consumed approximately 100% of one CPU core.

The tool result was not surfaced until 1,550.8 seconds later. After Codex continued, the next similar command immediately reproduced the same 100% CPU stall.

Contribution request

I have a focused local patch implementing the proposed guard and tests. Per the repository contribution policy, I am opening this issue before submitting any PR.

If this approach aligns with the intended TUI design and the team would like an external contribution, I would be happy to submit the PR after receiving an invitation.

https://github.com/nvax-r/codex/tree/fix_tui

Best regards,
Richard Cheng.

What steps can reproduce the bug?

  1. Start Codex CLI
  2. In a separate macOS terminal, generate a harmless ~4.7 KiB single-line shell command and copy it to the clipboard

```
python - <<'PY' | pbcopy
import base64

token = base64.b64encode(b"x" * 3500).decode()
print(f"!printf %s {token} | base64 -d >/dev/null")
PY
```

  1. Paste the copied line into the Codex composer and press Enter. The leading ! runs it as a user-shell command.
  2. Codex attempts to render the command as an ExecCell. On Codex CLI 0.144.5, the TUI becomes blank or unresponsive while the native Codex process consumes approximately 100% of one CPU core.
  3. Terminal input, command output, and other TUI updates remain blocked. In the original occurrence, the UI did not recover for approximately 1,550 seconds.

What is the expected behavior?

the harmless command completes immediately and the TUI remains responsive.

Additional information

_No response_

View original on GitHub ↗