CLI: set JJ_PAGER=cat for shell commands so jj output does not page
What version of Codex CLI is running?
codex-cli 0.130.0
What subscription do you have?
Pro
Which model were you using?
Any
What platform is your computer?
Darwin 24.6.0 arm64 arm
What terminal emulator and version are you using (if applicable)?
Any terminal.
Codex doctor report
N/A
What issue are you seeing?
Codex shell commands should avoid invoking pagers, but jj commands can still page because jj intentionally does not honor generic PAGER.
Codex already sets pager-related environment defaults such as PAGER=cat, GIT_PAGER=cat, and GH_PAGER=cat for unified exec commands. That works for many tools, but not for jj.
jj recently added a dedicated pager override, JJ_PAGER, in jj 0.41:
https://github.com/jj-vcs/jj/pull/9395
That PR explains why jj uses a jj-specific override instead of restoring generic $PAGER handling. So Codex needs to set JJ_PAGER=cat explicitly if it wants jj commands to behave like other non-interactive shell commands.
What steps can reproduce the bug?
- Use a jj version that supports
JJ_PAGER(jj0.41 or newer). - Run Codex in a jj repository.
- Ask Codex to run jj commands that can produce paged output, such as:
``sh``
jj log
jj diff
jj show
- Observe that jj may invoke its configured pager even though Codex already disables common pagers via
PAGER=cat,GIT_PAGER=cat, andGH_PAGER=cat.
What is the expected behavior?
Codex should set JJ_PAGER=cat in the same default shell-command environment where it sets other pager-disabling variables.
That would make jj commands behave consistently with git/GitHub CLI commands in Codex: output should be emitted directly to the command stream, not captured by an interactive pager.
Additional information
This should be a low-risk addition:
JJ_PAGERis jj-specific and only affects jj.- Older jj versions should ignore it.
- jj 0.41+ intentionally supports it as the correct tool-specific override.
- This is consistent with Codex already setting
GIT_PAGER=catandGH_PAGER=cat.
Workaround for users waiting on this, or if the Codex team decides this is too niche:
[shell_environment_policy.set]
JJ_PAGER = "cat"
Users do not need to repeat the existing pager variables in config. shell_environment_policy.set overlays specific variables on top of the inherited/default shell environment.
2 Comments
I checked current
main, and this looks like a narrow unified-exec environment default gap.Root cause / code path:
codex-rs/core/src/unified_exec/process_manager.rsviaUNIFIED_EXEC_ENV.PAGER=cat,GIT_PAGER=cat, andGH_PAGER=cat, but notJJ_PAGER=cat.unified_exec_env_injects_defaultsincodex-rs/core/src/unified_exec/process_manager_tests.rs.Minimal fix I verified locally:
("JJ_PAGER", "cat")toUNIFIED_EXEC_ENV.unified_exec_env_injects_defaults.Verification from a fresh checkout:
cargo test -p codex-core unified_exec_env --lib-> 2 passedcargo fmt --check-> passed; it emitted repeated stable-rustfmt warnings about the repo'simports_granularity = Itemsettinggit diff --check-> passedI am leaving this as issue analysis rather than opening a PR because
docs/contributing.mdsays external code PRs are invitation-only. I can open the patch if the Codex team wants it.Hey @jbetala7 no need to dig into the details on this one. If the Codex team wants this in the product, they have the tooling to complete this in a one shot with much less effort than it would take to handle an external PR (e.g.
codex implement https://github.com/openai/codex/issues/22604). The hardest part of this is not the code / analysis, it's deciding whether it's useful enough to do, and whether they want to spend time testing it.