iTerm2 cannot scroll up in interactive Codex session, including with --no-alt-screen
What version of Codex is running?
codex-cli 0.121.0
What subscription do you have?
_No response_
Which model were you using?
_No response_
What platform is your computer?
macOS (Darwin), terminal: iTerm2, architecture appears to be Apple Silicon (arm64)
What issue are you seeing?
In iTerm2, an interactive codex session cannot scroll back upward using the mouse wheel / trackpad scroll gesture.
This still happens when launching Codex with:
codex --no-alt-screen
That suggests the problem is not only alternate-screen handling. It looks like the Codex TUI is still capturing scroll input, or redraw behavior is preventing normal scrollback access.
In the same terminal environment, claude scrolls normally, so this does not appear to be a general iTerm2 configuration issue.
What steps can reproduce the bug?
- Open iTerm2 on macOS.
- Run
codex. - Generate enough output to require scrolling.
- Try to scroll upward with the mouse wheel or trackpad gesture.
- Observe that the terminal does not scroll back.
- Repeat with
codex --no-alt-screen. - Observe the same behavior.
What is the expected behavior?
Interactive Codex sessions should allow normal upward scrollback in iTerm2, especially when --no-alt-screen is used.
Additional information
Environment details collected locally:
echo $TERM
# xterm-256color
which codex
# ~/.bun/bin/codex
codex --version
# codex-cli 0.121.0
Additional notes:
tmuxis not involved (tmux lsreturned no server running).infocmp xterm-256color | rg smcupshows alternate-screen capability is present.- The package metadata points to
openai/codex(@openai/codex, installed globally via bun). - Upgrading with
bun install -g @openai/codex@lateststill installs0.121.0, so there was no newer version available to test.
If useful, I can also provide a short screen recording showing the behavior in iTerm2.
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗