codex icon indicating copy to clipboard operation
codex copied to clipboard

Codex client output truncated when scrolling in Zellij

Open ForSeason opened this issue 1 year ago • 66 comments

What version of Codex is running?

codex-cli 0.23.0

Which model were you using?

gpt5

What platform is your computer?

Darwin 24.6.0 arm64 arm

What steps can reproduce the bug?

When running the Codex client inside a Zellij session, the output history does not display correctly. Attempting to scroll within the Zellij pane shows truncated content instead of the full history. This makes it difficult to review previously generated output.

Image Image

Steps to reproduce it:

cargo install zellij
zellij
codex

Then try scrolling back using Zellij’s scroll mode.

What is the expected behavior?

Scrolling in Zellij should display the full history of Codex output without truncation.

What do you see instead?

Scrolling only shows partial output — earlier content is cut off.

Additional information

No response

ForSeason avatar Aug 21 '25 11:08 ForSeason

I get the same issue in multiple Mac based Terminals, inc the default. "Unlimited Scrollback" options can solve the issue if your software has it.

alexff8505 avatar Aug 21 '25 15:08 alexff8505

Hi, I am experiencing the same issue. Currently this prevents me from switching from claude code.

brunopeartree avatar Aug 22 '25 14:08 brunopeartree

Same here, this behavior only started showing up very recently

Artawower avatar Aug 23 '25 02:08 Artawower

Also seeing this on linux

warrenchortle avatar Aug 25 '25 03:08 warrenchortle

have this as well, does not seem to be a problem with zellij. since claude code has no such issue

luccahuguet avatar Aug 27 '25 15:08 luccahuguet

i've got some feedback from zellij's author that might be helpful

with the strong disclaimer that I have not tried to reproduce this myself and this is just an educated guess - this happens because the application is relying on the scrollbuffer in "Alternate Screen" (eg. with control code 1049), which the specification mentions should not exist (source: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html under "Alternate Screen Buffer").

I have tried in the past to be lenient with this behavior, because this is a common issue with some apps (can't blame them, not everyone spends time reading xterm specs), but allowing scrollbuffer in these cases causes a lot of other problems in apps that do follow the spec. Feel free to quote me on this.

luccahuguet avatar Aug 27 '25 16:08 luccahuguet

I have the same issue.

yogurt80 avatar Aug 28 '25 07:08 yogurt80

guys. in the new version you can just use ctrl t to view the history. easy peasy way to circumvent this issue while it's not fixed

luccahuguet avatar Aug 28 '25 12:08 luccahuguet

i've got some feedback from zellij's author that might be helpful

with the strong disclaimer that I have not tried to reproduce this myself and this is just an educated guess - this happens because the application is relying on the scrollbuffer in "Alternate Screen" (eg. with control code 1049), which the specification mentions should not exist (source: invisible-island.net/xterm/ctlseqs/ctlseqs.html under "Alternate Screen Buffer").

I have tried in the past to be lenient with this behavior, because this is a common issue with some apps (can't blame them, not everyone spends time reading xterm specs), but allowing scrollbuffer in these cases causes a lot of other problems in apps that do follow the spec. Feel free to quote me on this.

Do you have a link to that message? I'm curious what mode he recommends to use instead.

wkrettek avatar Aug 31 '25 17:08 wkrettek

The message was is zellij's discord

We'd be happy to have you there @wkrettek

you can find it here

https://zellij.dev/

you can ping me there, and then i just show you the message or you can ask the author yourself too

luccahuguet avatar Aug 31 '25 22:08 luccahuguet

Same issue with tmux and zellij in Ubuntu 24.04 (omakub)

albertojanza avatar Sep 11 '25 03:09 albertojanza

Same issue with Zellij on macOS.

WeZZard avatar Sep 25 '25 16:09 WeZZard

same on zellij + ghostty + macOS

tomas-b avatar Sep 28 '25 08:09 tomas-b

same on zellij + alaritty + macOS

yoogoc avatar Sep 30 '25 05:09 yoogoc

Same on Zellij + Alacritty + Fedora (Wayland // Niri)

clouedoc avatar Oct 11 '25 03:10 clouedoc

Same issue on: Kitty + Zellij (0.43.1) on Ubuntu 25.04

But I'm not entirely sure if I want it to be fixed!

Let me explain:

In Zellij, you can activate "Scroll / Edit Previous Message" Mode simple by pressing Esc twice. Then you can scroll using muse wheel, touch pad or arrow keys (or as set in your zellij config). Once done, just press q to quit.

This works well for me.

And in the normal mode, I can scroll to get CLI commands and messages that were present before I started codex.

Why would I want to change this?

SweaDev avatar Oct 12 '25 08:10 SweaDev

We've fixed a number of bugs since this bug report was filed. Are any of you still seeing this problem with the latest version of codex CLI?

etraut-openai avatar Nov 18 '25 07:11 etraut-openai

Scrolling still does not work for me in codex-cli version 0.58.0. Instead of displaying the codex history, previous messages from the shell are displayed

Artawower avatar Nov 18 '25 07:11 Artawower

We've fixed a number of bugs since this bug report was filed. Are any of you still seeing this problem with the latest version of codex CLI?

the problem persists. the only way to actually view codex's history in zellij is with ctrl t

luccahuguet avatar Nov 18 '25 12:11 luccahuguet

Thanks for confirming the problem still exists.

If someone from the community is interested in diagnosing this issue and contributing a targeted fix, we'd be interested in a PR. (Until recently, we were far behind in reviewing incoming PRs, but we have nearly caught up on our backlog.)

etraut-openai avatar Nov 18 '25 17:11 etraut-openai