Skip to content

iTerm2 + zsh: --no-alt-screen still does not produce usable native scrollback #20063

Closed as duplicate

Description

@nvk

What version of Codex CLI is running?

codex-cli 0.125.0

What subscription do you have?

No response

Which model were you using?

No response

What platform is your computer?

macOS 26.1 arm64 (Build 25B78)

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

iTerm2 3.7.0beta1

What shell are you using?

zsh

What issue are you seeing?

In iTerm2 with zsh, codex --no-alt-screen still does not behave like a true scrollback-preserving inline terminal mode.

Once the conversation exceeds one screen, native terminal scrollback is not reliably usable for reviewing earlier content. This appears similar to other reports where alternate screen is disabled, but Codex still performs fullscreen redraw behavior in the main buffer.

What steps can reproduce the bug?

  1. Open iTerm2.
  2. Start zsh.
  3. Run:
    codex --no-alt-screen
  4. Interact until the conversation exceeds terminal height.
  5. Try to scroll up using iTerm2’s native scrollback.
  6. Observe that earlier content is missing, truncated, or not preserved like normal append-only terminal output.

I also tested:

codex -c 'tui.alternate_screen="never"' --no-alt-screen

with the same result.

What is the expected behavior?

With --no-alt-screen, Codex should preserve previous conversation output in the normal terminal scrollback buffer, so earlier content can be reviewed using native terminal scrolling.

What do you see instead?

The currently visible rendered screen is available, but prior conversation history is not reliably preserved as native terminal scrollback.

Additional information

This looks like --no-alt-screen is disabling alternate screen entry, but Codex still uses fullscreen redraw patterns in the main buffer instead of a true inline / append-only renderer.

Potentially relevant behavior to confirm:

  • cursor addressing (CSI row;col H)
  • screen clears (CSI 2J)
  • scrollback purge (CSI 3J)
  • line clears (CSI K)
  • scroll regions (CSI r)
  • reverse index (ESC M)

If useful, I can attach a terminal capture produced with:

script -q /tmp/codex-iterm2.tlog codex --no-alt-screen

and inspect whether the output contains fullscreen control sequences instead of plain append-only terminal output.

Related issues

Those appear to describe the same class of problem in other terminals:
--no-alt-screen helps partially, but does not yet provide a true scrollback-safe inline mode everywhere.

Activity

  1. added
    bug
    CLI
    TUI
    on Apr 28, 2026
  2. github-actions commented on Apr 28, 2026

    @github-actions
    Contributor
  3. etraut-openai commented on Apr 28, 2026

    @etraut-openai
    Contributor

    See #19645 for details and workaround.

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

    CLITUIbug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions