Content Truncation When Running Codex TUI Inside Multiplexer(zellij)

Resolved 💬 1 comment Opened Oct 24, 2025 by Kangaxx-0 Closed Oct 24, 2025

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.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗