Windows Codex CLI loses terminal scrollback history after long responses

Open
#35,335 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
rust

Research direction

Start at the Codex CLI terminal/TUI rendering entry point and reproduce the issue with a response longer than one screen in VS Code's integrated terminal and Windows Terminal. Trace how long output is rendered and verify that completed responses remain in normal terminal scrollback on Windows 10 and 11.

Written by the indexing model from the issue text.

Description

bug CLI TUI windows-os
What version of Codex CLI is running?

codex-cli 0.145.0

What subscription do you have?

Plus

Which model were you using?

gpt-5.6sol

What platform is your computer?

Microsoft Windows NT 10.0.19045.0 x64

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

VS Code

Codex doctor report
## Windows: Codex CLI loses terminal scrollback history after long responses

### Codex version

codex-cli 0.145.0

### Platform

- Windows 10 x64
- Windows 11 x64

### Terminal environment

Tested with:

- VS Code integrated terminal
- Windows Terminal

Terminal supports VT processing and truecolor output.

Installation method:

- npm

### Describe the bug

When Codex generates a long response, once the output exceeds the visible terminal height, previous content disappears permanently.

The terminal scrollback buffer does not contain the missing content. Scrolling up with the mouse wheel or terminal scrollbar cannot recover the previous output.

It looks like Codex CLI is rendering the conversation inside a fixed-height TUI region and discarding content outside that region.

Other CLI AI coding tools (for example Claude Code) do not have this issue in the same terminal environment. Their previous output remains available through normal terminal scrolling.

### Steps to reproduce

1. Install Codex CLI on Windows.
2. Start a conversation.
3. Ask Codex to generate a long response (for example a large code explanation, architecture design, or file diff).
4. Wait until the response exceeds one terminal screen height.
5. Try scrolling back.

### Expected behavior

The complete conversation history should remain available through terminal scrollback, like normal CLI applications.

### Actual behavior

Older output disappears after leaving the visible terminal area.

### Additional information

I tested this on both Windows 10 and Windows 11, and the issue reproduces consistently.

The terminal itself works correctly with other CLI applications, so this appears to be related to Codex CLI's TUI rendering behavior rather than terminal configuration.

### Possible improvement

Please consider providing a non-TUI output mode or a setting that preserves normal terminal scrollback behavior, similar to traditional CLI output.
What issue are you seeing?

Codex CLI loses terminal scrollback history after long responses on Windows.

When Codex generates a response longer than the visible terminal area, previous output disappears permanently. Scrolling up with the terminal scrollbar or mouse wheel cannot recover the missing content.

It seems that Codex CLI renders output inside a fixed-height TUI area and discards content outside the visible region.

Environment:

  • Codex CLI version: 0.145.0
  • OS: Windows 10 x64 / Windows 11 x64
  • Installation method: npm
  • Terminal: VS Code integrated terminal and Windows Terminal

Other CLI AI coding tools such as Claude Code work correctly in the same terminal environment, where previous output remains available through normal terminal scrolling.

What steps can reproduce the bug?
  1. Install Codex CLI on Windows.
  2. Open Codex CLI in a terminal.
  3. Ask Codex to generate a long response, for example:
    • a large code explanation
    • architecture design
    • a large file diff
  4. Wait until the response exceeds one terminal screen height.
  5. Try scrolling back using the terminal scrollbar or mouse wheel.

Actual result:

The previous output is missing and cannot be recovered from the terminal scrollback buffer.

This happens consistently on both Windows 10 and Windows 11.

No special code snippet is required to reproduce this issue. Any sufficiently long Codex response triggers it.

What is the expected behavior?

The complete Codex response should remain available in the terminal scrollback buffer.

Users should be able to scroll back and review previous output, similar to normal CLI applications.

Long responses should not disappear after leaving the visible terminal area.

Additional information

I tested this with multiple terminals:

  • VS Code integrated terminal
  • Windows Terminal

The terminal scrollback works normally with other CLI applications, so this does not appear to be a terminal configuration issue.

The issue seems related to Codex CLI's TUI rendering behavior on Windows.

A possible improvement would be providing a non-TUI output mode or an option to preserve normal terminal scrollback behavior.

Dominant language
Rust
Stars
125k
Forks
19.5k
Avg merge
1m
Merged PRs (30d)
1k

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from openai/codex

All issues in openai/codex

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.