CLI tool
GuanhuaYe/codex-tmux-scroll avatar
GuanhuaYe/codex-tmux-scroll

codex-tmux-scroll: mouse-wheel history for Codex CLI inside tmux

Mouse-first fullscreen scrolling for Codex CLI, tuned for tmux workflows

401 stars11 forksShellApache-2.0

At a glance

What is it?
A patched Codex CLI build that turns the mouse wheel into a static conversation history view and keeps the prompt pinned at the bottom. It ships as a Linux x86_64 installer and a single patch file, not a plugin.
Who is it for?
Adopt codex-tmux-scroll if you already live in tmux, run Codex CLI on Linux x86_64, and lose time to wheel-scroll triggering prompt history instead of conversation history. Skip it if you are on macOS or ARM, if you need a plugin that survives every upstream release without a rebuild, or if you are not a tmux user at all.
Can I use it commercially?
Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 168 days ago.
What is it written in?
Mainly Shell, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 25, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • GuanhuaYe/codex-tmux-scroll401 ★ · -6
Star history
Repository2026-09-182026-11-25
GuanhuaYe/codex-tmux-scroll407401

-6 Stars in the last 68 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

The problem: wheel scrolling in tmux hits the wrong history buffer

Inside tmux with mouse mode enabled, the wheel event is delivered to the pane, not to the terminal emulator's own scrollback. Codex CLI, like many full-screen TUI programs, treats an up-scroll as prompt history navigation. The result is that a user who wants to reread an earlier model response instead walks backwards through their own previously typed prompts. The conversation content they were looking for is still on screen, but the wheel no longer reaches it in the way they expect.

The workaround most people discover is to enter tmux copy-mode and scroll there. That works, but it detaches the view from the live program: you are reading a frozen snapshot of the pane, and the moment you exit copy-mode you are back at the bottom with no indication of where you were. codex-tmux-scroll targets exactly this gap. It is for developers who keep Codex CLI open in a long-lived tmux session, on a project where the useful context is spread across many turns of output.

What the patch changes in the Codex CLI build

The repository does not vendor the Codex source tree. According to the README, the tmux-specific behavior lives in a single patch file, `patches/codex-tmux-scroll-v0.139.0.patch`, which is applied to an upstream Codex tag and then compiled. Everything outside that patch is upstream Codex, which is why the README can state that local auth, `config`, `AGENTS.md` and existing project workflows continue to work.

The behavioral changes are all in mouse handling. The wheel opens a static history view: new output arriving from the model does not move the content you are reading. A percentage indicator reports your position in the history. The input prompt stays visible at the bottom rather than scrolling away with the content. Drag selection with the left mouse button copies text out of the history, and a double-click on the prompt area returns you to the latest output. That last binding is the important one, because a static view with no fast way back is worse than no static view at all.

Install on Linux x86_64 and a first session in tmux

The README gives one install path, a shell script fetched over HTTPS and piped to bash. The installer writes a binary to `~/.local/lib/codex-tmux-scroll/codex` and a wrapper to `~/.local/bin/codex-tmux-scroll`. It explicitly does not replace your global `codex` command, so a broken install does not take your normal workflow down with it. Make sure `~/.local/bin` is on your PATH before you try the wrapper name.

bash
curl -fsSL https://raw.githubusercontent.com/GuanhuaYe/codex-tmux-scroll/main/install.sh | bash

Before any of the mouse behavior appears, tmux has to forward mouse events to the pane. The README says this is a one-time configuration and that new sessions pick it up automatically.

tmux
set -g mouse on

Then start a session, change into your project, and launch the wrapper. Arguments are forwarded to the bundled Codex CLI, so subcommands and flags you already use keep working.

bash
tmux new -s work
cd /path/to/project
codex-tmux-scroll

Once a conversation has some length, scroll up with the wheel. The expected result is a frozen history view with a percentage indicator and the prompt still visible at the bottom. Double-click the prompt area to jump back to live output. The README also shows `codex-tmux-scroll resume` and `codex-tmux-scroll --dangerously-bypass-approvals-and-sandbox resume` as valid launch forms, which confirms that argument forwarding is not limited to the bare command.

Platform limits and the rebase tax

The Status section of the README lists one base and one platform: Codex CLI `0.139.0` and Linux x86_64. There is no macOS build, no ARM build, and no Windows path documented. If you are on an Apple Silicon laptop, this project does not solve your problem today, and the related searches about scrolling up in tmux on a Mac are not answered by it.

The more structural limitation is the rebase tax. Because the changes are carried as a patch rather than merged upstream, every new Codex CLI release is a manual event. The README's own update procedure is six steps: pick the new tag, test whether the old patch still applies, copy the patch forward if it does, and if it does not, clone the upstream tag, run `git apply --reject`, fix the rejected hunks by hand, rebuild with `cargo build -p codex-cli --release`, regenerate the patch with `git diff --binary`, and package a new release. That is the maintainer's workflow, but it tells you what you are depending on. If upstream touches the same TUI code the patch modifies, there will be a gap between the upstream release and a working codex-tmux-scroll build, and during that gap you are on the old base version.

There is a second, quieter failure mode. The README does not document rollback. The installer does not replace your global `codex`, so recovery is a matter of deleting the wrapper and the library directory, but you will not find that instruction in the repository. Treat the install as additive and keep a note of the two paths it writes.

How this differs from tmux copy-mode and terminal scrollback

The obvious alternative is not another tool but tmux itself. Copy-mode already lets you scroll a pane, search it, and copy text. The difference is where the state lives. Copy-mode freezes the pane and hands you a separate navigation layer with its own key bindings; the running program has no idea you are looking at its past. codex-tmux-scroll moves the scrolling into the application, so the history view is something Codex renders and knows about. That is what makes the percentage indicator and the pinned prompt possible, and it is also why the double-click-to-return binding exists rather than a keybinding you already have in muscle memory.

The trade-off is real. Copy-mode works in every pane, for every program, with no install and no version coupling. codex-tmux-scroll works in one program, on one platform, and only as long as its patch applies to the Codex version you are running. If you scroll history rarely, copy-mode is the cheaper answer. If you scroll constantly and the prompt-history collision is a daily interruption, the patched build earns its maintenance cost.

Building, packaging and the licence position

The repository keeps `install.sh`, `patches/`, `scripts/` and `legal/` at the top level, and the README documents a local build path rather than requiring the published binary. The build script takes the upstream repository URL as an environment variable and picks the patch matching `CODEX_UPSTREAM_REF`.

bash
CODEX_UPSTREAM_URL=<codex-cli-upstream-git-url> \
./scripts/build-from-source.sh

The README notes that the build uses the Rust toolchain selected by the upstream source tree, and that `CODEX_RUST_TOOLCHAIN` overrides it. Packaging is a separate script, and it can take a prebuilt binary through `CODEX_TMUX_SCROLL_BINARY_PATH` when you have already compiled and tested one. Release tags follow `v<upstream-codex-version>-tmux.<patch-version>`, so `v0.139.0-tmux.3` means upstream 0.139.0 with the third revision of the tmux patch. That naming is worth reading carefully before you upgrade, because the leading number is the upstream version, not this project's own.

On licensing: the repository is Apache-2.0, and third-party notices are kept in `legal/THIRD_PARTY_NOTICES.md`. A patch-only distribution means the compiled binary is a derivative of upstream Codex, and the notices file is where that is accounted for. This is a description of what the repository contains, not legal advice; if you redistribute the binary inside a company, read the notices file and the upstream licence yourself.

Editorial conclusion

Adopt codex-tmux-scroll if you already live in tmux, run Codex CLI on Linux x86_64, and lose time to wheel-scroll triggering prompt history instead of conversation history. Skip it if you are on macOS or ARM, if you need a plugin that survives every upstream release without a rebuild, or if you are not a tmux user at all. Before installing, confirm two things: that your base Codex version is 0.139.0 or that a matching patch exists, and that you are comfortable with an installer that writes a binary and a wrapper into ~/.local rather than replacing your global codex. Then check `set -g mouse on` in your tmux config, because none of the wheel behavior works without it.

Frequently asked questions

How do I scroll up in Codex?

With codex-tmux-scroll, the mouse wheel opens a static history view of the conversation, with a percentage indicator showing your position. Double-click the prompt area to jump back to the latest output. Without the patch, the wheel reaches prompt history instead.

How do I scroll in tmux?

The README requires tmux mouse forwarding via `set -g mouse on`, which is a one-time configuration and applies to new sessions automatically. With that set, the wheel scrolls the Codex conversation rather than triggering prompt history navigation.

How to activate scroll mode?

There is no separate mode to activate. Install the build, set `set -g mouse on` in tmux, and launch `codex-tmux-scroll`; the wheel then opens the static history view while the prompt stays pinned at the bottom.

How do I scroll up in Claude Code using tmux?

codex-tmux-scroll is a patched build of Codex CLI and the README describes changes to Codex's own mouse handling only. It does not modify or wrap other terminal agents, so it offers nothing for Claude Code sessions.

Official sources

  1. GuanhuaYe/codex-tmux-scroll on GitHub
  2. License: Apache-2.0
  3. Project website
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/guanhuaye-codex-tmux-scroll.svg)](https://hysenlabs.com/projects/guanhuaye-codex-tmux-scroll)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/guanhuaye-codex-tmux-scroll.svg)](https://hysenlabs.com/projects/guanhuaye-codex-tmux-scroll)

Was this useful?