Mouse wheel scrolls prompt history instead of transcript when Codex CLI runs inside tmux
What version of Codex CLI is running?
codex-cli 0.146.0
What subscription do you have?
ChatGPT Prolite
Which model were you using?
gpt-5.6-sol The issue appears to be independent of the selected model.
What platform is your computer?
Ubuntu 24.04 LTS, Linux x86_64
What terminal emulator and version are you using (if applicable)?
Remote SSH terminal session using tmux 3.4. TERM=xterm-256color
Codex doctor report
Codex Doctor v0.146.0 · linux-x86_64
18 checks passed, 0 warnings, 0 failures.
Environment:
* Runtime: standalone Unix installation
* Terminal: tmux 3.4
* TERM=xterm-256color
* State databases: healthy
* Thread inventory: healthy
* Authentication: ChatGPT
* WebSocket: connected
* App server: running in persistent mode
What issue are you seeing?
When Codex CLI is running inside tmux, I cannot scroll through the conversation transcript or terminal viewport.
Using the mouse wheel does not move the transcript up or down. Instead, it changes the contents of the Codex prompt composer, cycling through previously submitted prompts. The same behavior occurs regardless of where I click before scrolling.
Keyboard scrolling shortcuts also fail to move through the Codex transcript while inside tmux. I have tried clicking different parts of the interface and following the troubleshooting suggestions provided by Codex, but none of them resolved the problem.
The issue only occurs inside tmux. If I exit tmux and launch Codex directly in the same SSH terminal, mouse-wheel scrolling works normally and I can navigate through the transcript as expected.
This makes Codex difficult to use for long-running tasks because I need tmux to keep the process running after disconnecting my local computer or SSH session.
What steps can reproduce the bug?
Uploaded thread: 019fb317-4274-77c1-83dd-5a6acbff8045
What is the expected behavior?
When Codex CLI is running inside tmux, the mouse wheel and appropriate keyboard shortcuts should scroll through the conversation transcript in the same way they do when Codex is running directly in the terminal.
Scrolling over the transcript should not modify the prompt composer or cycle through previously submitted prompts.
Codex should remain fully navigable inside tmux so that long-running sessions can continue after the SSH client disconnects.
Additional information
Steps to reproduce
- Connect to an Ubuntu Linux server through SSH.
- Start a tmux session:
tmux new -s codex
- Open a project directory and launch Codex CLI:
cd ~/Desenvolvimento/actb
codex
- Send enough prompts for the conversation transcript to extend beyond the visible terminal viewport.
- Place the mouse pointer over the conversation transcript and use the mouse wheel to scroll upward.
- Try the usual keyboard shortcuts for scrolling through the terminal or transcript.
- Observe that the transcript does not scroll. Instead, the mouse wheel cycles through previously submitted prompts inside the Codex composer.
- Exit or detach from tmux and launch Codex directly in the same SSH terminal.
- Repeat the scrolling action and observe that transcript scrolling works normally outside tmux.
Environment
- Codex CLI 0.146.0
- tmux 3.4
- Ubuntu 24.04 LTS
- TERM=xterm-256color
- Remote SSH session
- Codex works normally outside tmux in the same terminal
- Codex Doctor reports 18 successful checks, 0 warnings, and 0 failures
tmux is important for this workflow because it allows Codex tasks to continue running when the local computer is turned off or the SSH connection is interrupted.
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
- #36099
Powered by Codex Action
Additional macOS reproduction:
Environment
- Codex CLI:
0.146.0, installed through npm - Previous working version:
0.145.0 - OS: macOS 26.5.2, Apple Silicon (
arm64) - tmux:
3.6b TERM=screen-256color- tmux client terminal:
xterm-256color
Behavior
Mouse-wheel scrolling stopped working after upgrading Codex CLI from 0.145.0 to 0.146.0.
When Codex runs inside tmux, the mouse wheel does not scroll the conversation transcript. Other tmux settings and scrollback remain functional.
Workarounds already tested
Configured and restarted Codex with:
[tui]
alternate_screen = "never"
This did not fix the issue.
I verified after restart that:
- tmux reports
alternate_on=0; - tmux has
mouse on; - the default
WheelUpPanebinding is present; - the Codex pane has accumulated scrollback history;
- Codex is not reporting active mouse-capture flags.
I also enabled raw scrollback mode in the running session:
/raw on
Mouse-wheel scrolling still did not work.
This appears to be a regression in Codex CLI 0.146.0 when used inside tmux, rather than an alternate-screen or tmux mouse configuration problem.
Can confirm this bug.
Angel here, founder of Runa. Needing tmux to keep Codex alive, then losing transcript navigation, trades persistence for visibility. https://runacode.io runs Codex on a cloud machine; we measured ~46% lower token cost on real runs. New users get $50 of machine usage, and Codex signs in interactively with an existing ChatGPT subscription. Want to try your long-running workflow there?
I encountered the same problem.
I face this nowdays in Jetbrains terminals too
Another confirmation, plus a workaround that fully fixed this for me.
Environment: Codex CLI 0.156.1, macOS → Ghostty → SSH → tmux 3.x → Linux, TERM=tmux-256color.
Root cause found in my case: with tmux's mouse option off (mouse=0), mouse wheel events are not captured by tmux and get passed through to Codex, which interprets them as prompt-history cycling in the composer. Enabling mouse capture makes tmux intercept the wheel and scroll its own scrollback instead.
Fix:
tmux set -g mouse on
(and set -g mouse on in ~/.tmux.conf to persist)
After this, the wheel scrolls the full conversation transcript normally. Verified with tmux display-message -p 'alt=#{alternate_on} mouse=#{mouse}' → alt=0 mouse=1.
Notes:
- No Codex config change was needed — the default inline TUI works fine once tmux captures mouse events. I initially experimented with
[tui] alternate_screen = "never"and the/tuifullscreen toggle, but neither mattered oncemouse onwas set. - If keyboard scrolling is preferred,
Ctrl+b [(tmux copy mode) also works with mouse off — but the wheel going to Codex's composer instead of the transcript is arguably a Codex-side bug worth fixing: when Codex enables mouse reporting, tmux's default wheel behavior bypasses the scrollback, and Codex consuming wheel events for prompt history is surprising.
Using 0.159.0 have the same issue. But it was okay in 0.149, the issues appear after the new Codex CLI UI. btw, I am using iTerm2 tmux integration.
Another confirmation, plus a workaround that fully fixed this for me.
Environment: Codex CLI 0.156.1, macOS → Ghostty → SSH → tmux 3.x → Linux,
TERM=tmux-256color.Root cause found in my case: with tmux's
mouseoption off (mouse=0), mouse wheel events are not captured by tmux and get passed through to Codex, which interprets them as prompt-history cycling in the composer. Enabling mouse capture makes tmux intercept the wheel and scroll its own scrollback instead.Fix:
tmux set -g mouse on(and
set -g mouse onin~/.tmux.confto persist)After this, the wheel scrolls the full conversation transcript normally. Verified with
tmux display-message -p 'alt=#{alternate_on} mouse=#{mouse}'→alt=0 mouse=1.Notes:
- No Codex config change was needed — the default inline TUI works fine once tmux captures mouse events. I initially experimented with
[tui] alternate_screen = "never"and the/tuifullscreen toggle, but neither mattered oncemouse onwas set.- If keyboard scrolling is preferred,
Ctrl+b [(tmux copy mode) also works with mouse off — but the wheel going to Codex's composer instead of the transcript is arguably a Codex-side bug worth fixing: when Codex enables mouse reporting, tmux's default wheel behavior bypasses the scrollback, and Codex consuming wheel events for prompt history is surprising.
Yes, it works, you saved my life, thanks. By the way, opencode in tmux works fine without this option.
Another confirmation from a current release, with a particularly frustrating keyboard-only reproduction.
Environment
- Codex CLI:
0.161.0 - Client: macOS keyboard/terminal over SSH
- Server: Debian Trixie, x86_64
- tmux:
3.5a - tmux client terminal:
xterm-256color - tmux
mouse: alreadyon
Behavior
The conversation transcript cannot be navigated reliably. Regular keys such as Space or b are inserted into the Codex composer, as expected while the composer has focus, but there is no discoverable working keyboard route to scroll the transcript.
The following were all tested and did not solve the problem:
Ctrl-b [followed by arrows /Ctrl-u/Ctrl-d- the configured tmux
Ctrl-b+ Page Up binding - entering tmux copy mode externally with
tmux copy-mode -u(tmux briefly reportedmode=copy-mode) - tmux mouse mode (
mouse onwas already active) - restarting/resuming Codex with
codex --no-alt-screen resume --last
This is not just a minor inconvenience: long Codex sessions over SSH depend on tmux for persistence, and losing access to earlier output makes the session very difficult to use and to verify. Please treat reliable transcript scrolling in tmux—including a clear keyboard-only path—as an important CLI usability and accessibility requirement. A documented shortcut shown in the TUI would also help, but it needs to work independently of the prompt composer and terminal-specific Page Up keys.
The same problem on Mac OS 15.8 Intel, base Terminal app.
hi guys i'm with the latest 0.163.0 and this still happens
It is just ridiculous. Even open source OpenCode does not have this problem. What did OpenAI developers do? Do they know how to vibe code?
the issue is still here...
(response from codex)
I reproduced the prompt-history behavior with Codex CLI 0.163.0 on Ubuntu 24.04, GNOME Terminal, and tmux 3.4.
With tmux’s mouse option off, Codex does not capture mouse events. In this setup, wheel gestures reach Codex as Up/Down arrow-key sequences, which the composer uses to recall previous prompts. Disabling alternate-scroll mode (DEC 1007) alone did not prevent the translation.
A workaround for this case is to run:
tmux set -g mouse on
Then restart Codex. In my test, Codex enabled native mouse reporting after the restart, and scrolling over the conversation no longer changed the composer. To persist the setting, add set -g mouse on to ~/.tmux.conf.
There is a tradeoff: forcing mouse capture while tmux mouse mode is off can break normal terminal text selection, including in neighboring panes. That makes simply overriding the setting an unsafe fix.
This confirms the prompt-history failure and the workaround for one configuration. I have not yet verified scrolling through a long transcript, and it does not explain the reports where mouse on was already active. Those need a separate input-routing check.
Additional report on Codex CLI 0.169.0, macOS 27.0.1 (Apple Silicon), Ghostty 1.4.0, using a trackpad.
Two-finger scrolling navigates input history instead of scrolling the conversation/output. This prevents reading earlier output using the normal macOS scrolling gesture and is extremely frustrating in everyday use.
This report is outside tmux: the local Codex TUI process ancestry is Ghostty → login → zsh → codex, with no tmux layer. The tool environment also has neither TMUX nor ZELLIJ set.
The existing global Codex configuration already contains:
[tui]
alternate_screen = "never"
Terminal environment: TERM=xterm-ghostty, TERM_PROGRAM=ghostty, TERM_PROGRAM_VERSION=1.4.0.
Expected: two-finger scrolling should scroll the output/transcript without recalling previous prompts in the composer. If gesture-based input-history navigation is intentional anywhere, please provide an obvious way to disable it.
The symptom above is reported by the affected user; environment, process ancestry, CLI version, and existing configuration were inspected locally by Codex at the user's request. No independent gesture reproduction, terminal-input capture, or restart/configuration A/B test was performed, so this does not establish that the underlying cause matches the tmux-specific cases above.
Thanks for the bug report. This will be addressed in an upcoming release.