TUI startup banner border wraps incorrectly in narrow terminals

Resolved 💬 2 comments Opened Jul 19, 2026 by BobbyWang0120 Closed Jul 22, 2026
💡 Likely answer: A maintainer (etraut-openai, contributor) responded on this thread — see the highlighted reply below.

What version of Codex CLI is running?

0.144.6 (latest release at the time of filing)

What subscription do you have?

Not provided; this layout issue should be independent of subscription.

Which model were you using?

gpt-5.6-sol, xhigh reasoning

What platform is your computer?

Darwin 25.5.0 arm64 arm

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

Not provided. No terminal multiplexer was reported.

Codex doctor report

Not included because the issue is limited to deterministic startup layout at narrow terminal widths.

What issue are you seeing?

The interactive TUI startup banner is not responsive when the terminal is narrow. The banner is rendered wider than the available viewport, so its horizontal border glyphs overflow and wrap onto additional lines. Content near the right edge, including the model-change hint, also wraps awkwardly outside the intended layout.

What steps can reproduce the bug?

  1. Open a terminal and reduce its width to roughly 80 columns, or start wider and resize it until it is narrower than the startup banner.
  2. Run codex.
  3. Look at the initial OpenAI Codex banner before entering a prompt.
  4. Observe that the top and bottom border lines wrap, leaving short detached border segments on following lines.

What is the expected behavior?

The startup banner should clamp its width to the available terminal viewport. Its border should remain intact, and inner content should responsively wrap, truncate, or collapse without drawing beyond the right edge.

Additional information

This reproduces on the current latest release, 0.144.6.

Screenshot evidence

<img width="433" height="394" alt="Image" src="https://github.com/user-attachments/assets/2e1ff4fe-2860-4abd-b7fd-1451d713a1c5" />

View original on GitHub ↗

2 Comments

Kevinjohn · 1 month ago

I reproduced this against current main (854a82dbfd) using a 44-column session header.

The width calculation correctly reserves 40 columns for the banner's inner content. However, the border is subsequently sized from the widest untruncated row. With the model, reasoning effort, fast-mode indicator, and command hint present, that row expands the complete banner to 60 columns, causing the border to wrap.

I have prepared a focused patch that:

  • Truncates each styled header row to the already-calculated safe inner width, using the existing ellipsis helper.
  • Preserves the existing content-sized banner on wider terminals.
  • Adds a snapshot regression test proving that a requested width of 44 produces an exactly 44-column banner.

Actual before

The 44-column regression test fails because the rendered banner expands to 60 columns:

!Before: 44-column session header expands beyond the available width

Actual after

The same test passes, with the content truncated cleanly and the border remaining within 44 columns:

!After: session header remains within the requested 44-column width

Validation:

  • New narrow-width snapshot regression test passes.
  • Full codex-tui suite passes: 3,173 tests.
  • Scoped Clippy/fix check passes.
  • Repository formatting passes.

---

I have a PR ready if issue accepted

etraut-openai contributor · 1 month ago

Thanks for the bug report. This will be addressed in the next release.