Codex TUI freezes after Zellij detach/reattach; suspending before detach avoids it

Resolved 💬 5 comments Opened Jul 31, 2026 by fakegiraffe Closed Aug 20, 2026

When Codex is running in the foreground of a Zellij pane, detaching and
reattaching the Zellij session reliably leaves the Codex TUI frozen.

The Codex process remains alive, but the pane no longer displays updates or
visible keyboard input. Resizing or zooming the pane does not cause Codex to
redraw.

Suspending Codex with Ctrl+Z before detaching, then running fg after
reattaching, avoids the problem.

Environment

  • OS: Arch Linux
  • Desktop/compositor: Hyprland / Wayland
  • Codex CLI: 0.146.0
  • Also reproduced on Codex CLI: 0.144.5
  • Zellij: 0.44.3
  • Kitty: 0.47.4
  • Kernel: Linux 7.1.3-arch2-1
  • TERM: screen-256color
  • COLORTERM: truecolor
  • ZELLIJ: 0
  • Zellij session contains vertically split panes

Steps to reproduce

  1. Open Kitty under Hyprland.
  2. Start or attach to a Zellij session.
  3. Start Codex in a Zellij pane.
  4. Verify that Codex accepts input and updates normally.
  5. Leave Codex running in the foreground.
  6. Detach from Zellij normally.
  7. Reattach to the same Zellij session.
  8. Try typing into Codex or wait for an update.

Expected behavior

Codex should continue accepting input and redraw normally after the Zellij
session is reattached.

Actual behavior

The Codex pane remains visually frozen. New input and updates are not shown.

If the pane is zoomed from approximately half the terminal width to full width,
the old Codex contents remain on the left at their previous width, while the
newly exposed right side is blank. This indicates that Codex is not processing
the resize or redraw after reattachment.

Reproducibility

Reliable on this machine when detaching and reattaching Zellij.

Changing Zellij tabs without detaching does not reproduce the problem.

A second workstation with a similar software stack does not reproduce it. That
workstation has a substantially larger display, so terminal dimensions or redraw
load might influence whether the issue triggers.

Attempted troubleshooting

The following did not recover or prevent the frozen TUI:

  • Upgrading Codex from 0.144.5 to 0.146.0
  • Resetting the Kitty terminal
  • Sending SIGWINCH to Codex
  • Setting tui.alternate_screen = "always"
  • Switching Zellij tabs
  • Zooming/resizing the Zellij pane

The Codex process was still alive and in the foreground when inspected.

Working workaround

Before detaching:

  1. Press Ctrl+Z to suspend Codex.
  2. Detach from Zellij.

After reattaching:

  1. Run fg.

Codex then resumes, redraws, and accepts input normally.

This suggests that the Codex TUI event/render loop does not survive Zellij's
detach/reattach terminal lifecycle while Codex owns the foreground terminal,
whereas SIGCONT/foreground restor

View original on GitHub ↗

5 Comments

jacosro · 23 days ago

Happening to me also in Kubuntu 24.04 using Ghostty and Codex CLI v0.146.0

nomeata · 16 days ago

Are there workarounds that can recover from this after it happens?

Do we know if this is a bug in zellij or codex?

nomeata · 16 days ago

This also sounds related (and is supposedly fixed): https://github.com/openai/codex/issues/33037

nomeata · 15 days ago

Couldn't reproduce with v0.147.0 so maybe #33037 fixed it.

fakegiraffe · 7 days ago

I can confirm 0.148.0 on Arch Linux is fixed and working as expected.