Codex Terminal Stuck After Resize? Force a Safe Redraw

Codex Terminal Stuck After Resize? Force a Safe Redraw

Aident AI

A broad violet frame shifts around a luminous cyan field while a coral form expands into the newly opened space.

Codex Terminal Stuck After Resize? Force a Safe Redraw

If Codex keeps drawing at the terminal's old width or height after you resize the window, do not reset the repository or delete the task. First resize the window once more by a small amount, then press Ctrl-L to request a redraw. If the viewport is still stale, preserve your work, exit Codex normally, update it through the installer that owns your current installation, and resume the task.

This guide covers a narrow signature: the terminal itself has the new dimensions, but Codex continues to render inside the old rectangle. It does not cover missing scrollback, a viewport that jumps when a response completes, or a terminal that is simply too small for the current layout.

Match the Stale-Size Signature

Resize the window while Codex is idle, then look for one or more of these symptoms:

  • lines wrap at the previous width;

  • the bottom of the interface stops at the previous height;

  • a newly exposed strip of the window remains blank;

  • the cursor or status area is drawn inside the old boundary; or

  • another small resize suddenly makes the layout snap to the correct size.

Use a different recovery path when the symptom differs:

What you observe

Likely boundary

First safe action

Codex still draws inside the old rows and columns

Resize event or TUI redraw state

Resize once more, then press Ctrl-L

The viewport jumps only when a long response finishes

Completion-time rich-output reflow

Use the Codex iTerm2 scroll-jump guide

Old output cannot be reached at all

Terminal scrollback or alternate-screen policy

Review the terminal's scrollback settings

The screen briefly flashes blank but recovers

Transient redraw during resize

Record versions and test one controlled resize

The shell also reports the old size

Terminal, multiplexer, SSH, or PTY boundary

Diagnose that layer before changing Codex

Do not run git reset, remove Codex state, or clear the task. A drawing problem is not evidence that the repository or conversation is corrupt.

Preserve the Work Before Testing

Wait for the current response or command to finish. If Codex produced a result you need, save it to a reviewed project file or copy the necessary non-secret excerpt. Then record the current version:

codex --version

Also note the operating system, terminal name and version, and whether tmux, screen, zellij, SSH, WSL, or another PTY layer sits between Codex and the terminal. Those layers can receive or relay resize events independently.

Do not paste a full diagnostic bundle into a public issue. It can contain local paths, configuration, provider details, or other private context.

Try the Lowest-Risk Redraw Sequence

Use this sequence once, stopping as soon as the layout is correct:

  1. Drag one edge of the terminal by a few columns or rows.

  2. Pause briefly and check whether Codex fills the new area.

  3. Press Ctrl-L once to request a terminal redraw.

  4. If your current Codex interface offers a safe task or agent switch, switch away and back only after the active work is saved.

  5. If the stale rectangle remains, exit Codex normally and resume the task from a fresh process.

The original upstream report says switching agents forced a redraw, and later comments report that Ctrl-L or a second resize sometimes recovered the viewport. These are user-reported containment steps, not an OpenAI-confirmed fix. They are useful because they do not rewrite project files or Codex state.

Avoid repeatedly resizing while a command is running. A noisy reproduction makes it harder to tell which event restored the display and can obscure output you need to inspect.

Check Whether the Terminal Knows Its New Size

Open a separate ordinary shell in the same terminal application, or a neighboring pane that is not running inside Codex, and run:

stty size

The command prints rows first and columns second. Resize that shell and run it again. If the numbers change there while Codex still uses the old rectangle, the terminal can observe the new geometry and the remaining failure is more likely in the Codex TUI or the PTY path feeding that process.

If the numbers do not change, inspect the intermediate layer first. For example, reproduce without tmux or SSH before filing a Codex-specific report. Do not use stty size through a non-interactive tool call inside Codex as definitive evidence; that subprocess may not own a controlling terminal.

The upstream issue includes a case where the PTY size was correct while Codex remained visually stale. That establishes that a correct size reading does not guarantee the current viewport has redrawn.

Update Without Mixing Variables

If the problem survives one redraw sequence, update Codex through the same installation path that owns the current binary. Follow the current instructions in the official Codex repository, then confirm the new version:

codex --version

Test one resize before changing terminal settings, installing a multiplexer, or editing shell startup files. A one-variable test tells you whether the version change mattered.

The selected issue was closed after the reporter said the problem no longer occurred. It does not identify a fixed Codex version, merged change, or confirmed root cause. Do not claim that every current release contains a specific fix. Updating is a safe first comparison, not proof of resolution.

Run One Controlled Reproduction

Use a disposable Codex task with no deployment, database write, or approval waiting in the transcript:

  1. Start Codex in a terminal at a known size.

  2. Ask for a short read-only response with several wrapped lines.

  3. Widen the terminal once and record whether the text reflows.

  4. Make the terminal taller once and record whether the bottom status area moves.

  5. Run stty size in a separate shell at the original and final dimensions.

  6. Record whether a second resize, Ctrl-L, or a normal restart restored the layout.

One failing pass is enough. Repeating the test many times can hide an intermittent resize-delivery problem.

Useful evidence is compact:

  • Codex version;

  • operating system and architecture;

  • terminal and version;

  • initial and final rows and columns;

  • multiplexer, SSH, or WSL presence;

  • whether the separate shell saw the new size;

  • whether the second resize, Ctrl-L, or restart redrew Codex; and

  • the matching upstream issue URL.

Why a Correct PTY Size Can Still Look Wrong

A terminal resize normally updates the PTY dimensions and signals the foreground process. A terminal UI must then receive that change, recompute its layout, and repaint the affected region. A failure at the redraw stage can leave the process aware of the new geometry while the visible interface still reflects an older viewport.

That explanation fits the reported evidence, but it is not a confirmed diagnosis of Codex issue 21978. The report spans Ghostty on macOS and a later Alacritty/Sway case on Linux, which makes a terminal-specific explanation insufficient on its own. Multiplexers, remote shells, and platform event delivery remain separate variables.

Report the Result Without Losing Context

Add a concise reproduction to the matching upstream issue if the exact stale-size signature returns on a current version. Search for an existing report before opening a duplicate. Include the matrix above, but omit prompts, model output, repository names, secrets, and full local diagnostics.

If the display problem blocks a critical task, finish the work in a fresh terminal process after saving the relevant state. A normal exit and resume is safer than deleting the task or treating the viewport as evidence that the underlying work disappeared.

Monitor the Resize Issue With Aident Loadout

Start with the canonical setup instruction:

Follow https://aident.ai/SETUP.md

Then give your agent a bounded, read-only request:

Check Aident Loadout authentication and Vault status. Discover the current GitHub issue-search and issue-read Actions, inspect their schemas, and preflight them. If the estimates are free, return the state, close reason, updated time, labels, comment count, and canonical URL for openai/codex issue 21978, plus at most three newer open issues containing terminal resize, stale viewport, or old terminal size. Do not create, edit, close, label, comment on, or react to any issue.

The measurable result is one current source record and up to three possible successors with no provider write. It also keeps a future refresh tied to upstream evidence rather than an assumed release.

For the distinct completion-time viewport failure, use Codex iTerm2 Jumps to the Top? Test Raw Output.

Set up Aident Loadout and monitor the Codex resize issue read-only

Sources

Refresh this guide when issue 21978 gains a confirmed fix reference, a Codex release documents resize behavior, or a new current issue establishes a different safe recovery path.

Home

Home

Home

Integrations

Integrations

Integrations

Vault

Vault

Vault

Audit

Audit

Audit

Arana Grande

Arana Grande

Arana Grande

Free

Free

Free

30-day audit summary

30-day audit summary

30-day audit summary

Daily action-call volume and the latest receipts from the Loadout audit trail.

Daily action-call volume and the latest receipts from the Loadout audit trail.

Daily action-call volume and the latest receipts from the Loadout audit trail.

View Audit

View Audit

View Audit

Loadout usage

Loadout usage

Loadout usage

617 action calls in the last 30 days

617 action calls in the last 30 days

617 action calls in the last 30 days

May 19 - Jun 17

May 19 - Jun 17

May 19 - Jun 17

10 active days

10 active days

10 active days

Less

Less

Less

More

More

More

Recent activity

Recent activity

Recent activity

Latest action-call receipts from connected agents

Latest action-call receipts from connected agents

Latest action-call receipts from connected agents

Apr 23, 09:23 AM

Apr 23, 09:23 AM

Apr 23, 09:23 AM

Shopify

Shopify

Shopify

Creates Or Updates An Asset For A Theme

Creates Or Updates An Asset For A Theme

Creates Or Updates An Asset For A Theme

Success

Success

Success

Apr 23, 09:21 AM

Apr 23, 09:21 AM

Apr 23, 09:21 AM

Shopify

Shopify

Shopify

Update Products Param Product Id

Update Products Param Product Id

Update Products Param Product Id

Success

Success

Success

Apr 23, 08:53 AM

Apr 23, 08:53 AM

Apr 23, 08:53 AM

Shopify

Shopify

Shopify

Update Products Param Product Id

Update Products Param Product Id

Update Products Param Product Id

Failed

Failed

Failed

Apr 22, 22:13 PM

Apr 22, 22:13 PM

Apr 22, 22:13 PM

Shopify

Shopify

Shopify

Create Product Image

Create Product Image

Create Product Image

Success

Success

Success

Apr 22, 22:12 PM

Apr 22, 22:12 PM

Apr 22, 22:12 PM

Shopify

Shopify

Shopify

Create Product Image

Create Product Image

Create Product Image

Success

Success

Success

Connected integration coverage

Connected integration coverage

Connected integration coverage

162

162

162

of 753 accessible connected

of 753 accessible connected

of 753 accessible connected

Callable actions

Callable actions

Callable actions

1,126

1,126

1,126

Vault credentials

Vault credentials

Vault credentials

8

8

8

Explore what's possible

Explore what's possible

Explore what's possible

See all Integrations

See all Integrations

See all Integrations

Google Ads

Google Ads

Google Ads

All available Goolge Ads tools via...

All available Goolge Ads tools via...

All available Goolge Ads tools via...

X (twitter)

X (twitter)

X (twitter)

All available X tools via...

All available X tools via...

All available X tools via...

Github

Github

Github

All available Github tools via...

All available Github tools via...

All available Github tools via...

Notion

Notion

Notion

All available Notion tools via...

All available Notion tools via...

All available Notion tools via...

Slack

Slack

Slack

All available Slack tools via...

All available Slack tools via...

All available Slack tools via...

Firecrawl

Firecrawl

Firecrawl

All available Firecrawl tools via...

All available Firecrawl tools via...

All available Firecrawl tools via...

753 integrations are available for loadouts.

753 integrations are available for loadouts.

753 integrations are available for loadouts.

The one tool

for every tool

your agent needs.

Give any AI agent real capabilities in seconds. Connect 27,000+ tools once, skip the setup headache, and let your agents execute.

Try Aident Loadout

Empower your Codex or OpenClaws to get real jobs done. Connect 27,000+ tools in one prompt, and let your agents deliver real results.

Try Aident Loadout

Empower your Codex or OpenClaws to get real jobs done. Connect 27,000+ tools in one prompt, and let your agents deliver real results.

Try Aident Loadout

Empower your Codex or OpenClaws to get real jobs done. Connect 27,000+ tools in one prompt, and let your agents deliver real results.