Skip to content

Output width remains truncated after resizing Codex CLI window back to full size #5576

Closed

Description

@BobbyWang0120

What version of Codex is running?

0.47.0

What subscription do you have?

Pro plan

Which model were you using?

gpt-5-high

What platform is your computer?

macOS

What issue are you seeing?

When the Codex CLI is producing output and I resize the terminal window to a smaller (half) width, the new output lines wrap to fit the reduced width. However, when I resize the window back to the original/full width while Codex is still outputting, the subsequent output remains constrained to the smaller width. It does not expand to fill the full width of the terminal, so the text continues to wrap at the narrower width even though the window has been restored.

What steps can reproduce the bug?

  1. Launch the Codex CLI and start a task that prints multiple lines of output continuously.
  2. While the CLI is outputting content, resize the terminal or window to approximately half of its original width.
  3. Notice that the new output lines adjust to the smaller width as expected.
  4. Without stopping the task, resize the terminal back to its original or a wider width.
  5. Observe that the subsequent output still uses the narrower width, even though the window has been resized back to full size.

What is the expected behavior?

After resizing the window back to its original or larger width, the Codex CLI should adjust the output to the new width. New lines of output should wrap according to the current window size, so they use the full available width rather than remaining restricted to the narrower width used during the temporary resize.

Additional information

No response

Activity

  1. added
    bug
    on Oct 23, 2025
  2. github-actions commented on Oct 23, 2025

    @github-actions
    Contributor
  3. etraut-openai commented on Oct 24, 2025

    @etraut-openai
    Contributor

    Thanks for posting. I think this may be a duplicate of #5259. If so, let's close this one. And feel free to upvote the existing issue.

  4. added
    TUI
    on Nov 15, 2025
  5. PaulRBerg commented on Dec 19, 2025

    @PaulRBerg

    Still happening in Codex v0.75.0 in Warp terminal v0.2025.12.17.17.17.stable_02

    Initial Width of Terminal

    Expanded Width of Terminal

    Codex text has not resized according to the terminal

  6. mert-kurttutan commented on Dec 29, 2025

    @mert-kurttutan

    Still happening in 0.77. I think this should be prioritized. It is very annoying when giving codex a chance to try out. Not a good a first impression

  7. felixmin commented on Jan 29, 2026

    @felixmin

    +1, this is extremely annoying and regularly makes me write "repeat your response"

  8. PaulRBerg commented on Jan 29, 2026

    @PaulRBerg

    Still happening in v0.92

  9. vprasanth commented on Jan 30, 2026

    @vprasanth

    This is pretty big issue for a tool built to run in the terminal

  10. pthrasher commented on Feb 9, 2026

    @pthrasher

    FYI - I just submitted a PR that fixes this: #11221

  11. 4 remaining items

  12. geekerzhou commented on Mar 30, 2026

    @geekerzhou

    +1

  13. figelwump commented on Apr 1, 2026

    @figelwump

    I can reproduce this reliably in Ghostty. The issue is not limited to width changes:

    • Setup a vertical split. Run codex in one of the splits and load some content that fills scrollback.
    • Expand the pane using focus mode (in ghostty that is cmd-shift-enter) so it becomes full-height
    • The height of the rendered codex UI does not change even though the enclosing terminal has changed. Scrolling works, but if you type anything in the message bar, codex resets scroll position so message field is mid-terminal (because it's still rendering it as if it's half-height).

    Some more data:

    • The PTY size is correct when Codex is this stale state.
      Example from a live repro:
      stty -f /dev/ttys023 size
      63 206
    
    - I monitored the TTY during focus enter/exit and the kernel winsize changed correctly when toggling focus mode:
    
        30 102
        63 206
        30 102
        63 206
        30 102
    - In the embedding host, the terminal surface also resized correctly at the same time.
    - Manually sending SIGWINCH to the affected foreground process group did not fix the stale rendering.
    
    This makes features like focus mode (or any feature that requires changing the size of a codex terminal) frustrating to work with.
    
  14. bmizerany commented on May 9, 2026

    @bmizerany

    I found a workaround. It’s annoying, but it consistently works for me:

    Switch to another agent, then switch back. Codex appears to always have at least one background agent running, and changing agents seems to force a redraw. It is the only way I can get codex to redraw without exit+resume.

    Sometimes Ctrl-l will fix it, maybe.

    I’ve seen something similar in Claude Code, which also has gnarly TUI redraw issues: opening the full transcript view and then closing it also forces a redraw. That transcript workaround does not work in Codex, but the agent-switching workaround does.

    For comparison, applications like nvim, top, etc. resize perfectly in the same environment, which removes the ever-so-slight suspicion it could be a Ghostty issue (which was a very low suspicion).

    EDIT: I updated to 0.130.0 and the issue persists.

  15. etraut-openai commented on May 9, 2026

    @etraut-openai
    Contributor

    The original bug described in this bug report has been fixed.

    @bmizerany, if you're still seeing similar behavior, please open a new bug report and fill in all of the information request in the bug report template.

  16. bmizerany commented on May 9, 2026

    @bmizerany

    The original bug described in this bug report has been fixed.

    What release?

  17. etraut-openai commented on May 9, 2026

    @etraut-openai
    Contributor

    I think it was 0.129.0. Make sure you're running the latest (0.130.0 or newer).

  18. bmizerany commented on May 9, 2026

    @bmizerany

    EDIT: I updated to 0.130.0 and the issue persists.

    #5576 (comment)

  19. bmizerany commented on May 9, 2026

    @bmizerany
  20. etraut-openai commented on May 9, 2026

    @etraut-openai
    Contributor

    If you are still seeing cases where the issue persists, please create a new bug report and fill out all of the information in the bug report template including detailed repro steps.

  21. locked as resolved and limited conversation to collaborators on May 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    TUIbug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions