iTerm2 + zsh: --no-alt-screen still does not produce usable native scrollback
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?
- Open iTerm2.
- Start
zsh. - Run:
``sh``
codex --no-alt-screen
- Interact until the conversation exceeds terminal height.
- Try to scroll up using iTerm2’s native scrollback.
- 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
- #2558
- #10331
- #14277
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.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗