Skip to content

Content Truncation When Running Codex TUI Inside Multiplexer(zellij) #5643

Closed

Description

@Kangaxx-0

What version of Codex is running?

I built the binary from the latest source

What subscription do you have?

Pro

Which model were you using?

default

What platform is your computer?

Darwin 25.0.0 arm64 arm

What issue are you seeing?

When running codex TUI inside the Zellij terminal multiplexer, content is truncated and scrollback history is lost. Previous terminal output (cargo builds, shell prompts, user commands) gets cleared and is unrecoverable. The same session works correctly in regular terminals (iTerm2, Zed, etc.).

What steps can reproduce the bug?

  1. Open Zellij terminal multiplexer
  2. Run some commands to generate output (e.g., cargo build, ls)
  3. Run codex to start the TUI
  4. Observe that previous terminal content disappears
  5. Scroll up in Zellij - previous content is gone (not just hidden)

What is the expected behavior?

No response

Additional information

The insert_history_lines() function in codex-rs/tui/src/insert_history.rs uses ANSI scroll region commands (DECSTBM) to inject history above the active viewport.

queue!(writer, Clear(ClearType::UntilNewLine)).ok(); 

This clear command is executed inside a scroll region, and Zellij interprets it strictly, permanently wiping content.

Activity

  1. added
    bug
    on Oct 24, 2025
  2. Kangaxx-0 commented on Oct 24, 2025

    @Kangaxx-0
    Author

    I am going to close this bug, after some investigation, I think this behavior is not a codex issue. Clear operations within a DECSTBM scroll region can affect content outside the region boundaries, this is why the context got truncated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions