Skip to content

feat(tui): remove Zellij TUI workarounds#22214

Merged
fcoury-oai merged 5 commits into
mainfrom
fcoury/remove-zellij-workaround
May 13, 2026
Merged

feat(tui): remove Zellij TUI workarounds#22214
fcoury-oai merged 5 commits into
mainfrom
fcoury/remove-zellij-workaround

Conversation

@fcoury-oai
Copy link
Copy Markdown
Contributor

@fcoury-oai fcoury-oai commented May 11, 2026

Why

We added Zellij-specific TUI workarounds because older Zellij behavior did not work with Codex's normal terminal model:

This PR removes both workarounds because the latest Zellij release tested locally (zellij 0.44.1) works correctly with Codex's standard TUI behavior: normal alternate-screen handling, redraw, and history insertion.

What Changed

  • Removed the InsertHistoryMode::Zellij path and the Zellij-only newline scrollback insertion behavior.
  • Removed cached is_zellij state from the TUI and composer.
  • Removed Zellij-specific composer styling, the helper snapshot, and the TerminalInfo::is_zellij() convenience method that only served this workaround.
  • Changed tui.alternate_screen = "auto" to use alternate screen for Zellij too; --no-alt-screen and tui.alternate_screen = "never" still preserve the inline mode escape hatch.
  • Updated the generated config schema description for tui.alternate_screen.

How to Test

Manual smoke path used with zellij 0.44.1:

  1. Build and run this branch inside a Zellij 0.44.1 session with default config.
  2. Start Codex normally and produce enough assistant/tool output to create scrollback.
  3. Confirm the transcript remains readable, the composer renders normally, and scrolling through terminal history works.
  4. Resize the Zellij pane while output exists and confirm the TUI redraws without duplicated, missing, or stale rows.
  5. Compare with --no-alt-screen or -c tui.alternate_screen=never if you want to verify the inline fallback still works.

Targeted tests:

  • just write-config-schema
  • just fmt
  • just fix -p codex-tui
  • cargo test -p codex-terminal-detection
  • cargo test -p codex-tui alternate_screen_auto_uses_alt_screen

Attempted but did not complete locally:

  • cargo test -p codex-tui built and ran the new test successfully, then failed later on unrelated local failures in status_permissions_full_disk_managed_* and a stack overflow in tests::fork_last_filters_latest_session_by_cwd_unless_show_all.

Documentation

No developers.openai.com Codex documentation update is needed for this revert.

Copy link
Copy Markdown
Contributor

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8ed2541bce

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread codex-rs/tui/src/insert_history.rs
fcoury-oai added a commit that referenced this pull request May 11, 2026
Copy link
Copy Markdown
Contributor

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review


P2 Badge Preserve the public Zellij detection helper

Removing this public method is a breaking API change for users of codex-terminal-detection: existing callers that rely on TerminalInfo::is_zellij() now fail to compile even though the underlying multiplexer data still exists. If the workaround is gone, keeping this helper as a stable convenience avoids breaking downstream code.


/// Formats the terminal info as a User-Agent token.

P2 Badge Preserve the public Zellij detection helper

Removing this public method is a breaking API change for users of codex-terminal-detection: existing callers that rely on TerminalInfo::is_zellij() now fail to compile even though the underlying multiplexer data still exists. If the workaround is gone, keeping this helper as a stable convenience avoids breaking downstream code.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread codex-rs/tui/src/tui.rs Outdated
Comment thread codex-rs/tui/src/insert_history.rs
@fcoury-oai fcoury-oai requested a review from a team as a code owner May 11, 2026 21:32
@fcoury-oai fcoury-oai changed the title Remove Zellij redraw workaround Remove Zellij TUI workarounds May 11, 2026
@fcoury-oai fcoury-oai force-pushed the fcoury/remove-zellij-workaround branch from 6140c2b to da19ebc Compare May 12, 2026 04:43
Treat tui.alternate_screen = "auto" the same as normal alternate-screen mode, leaving never and --no-alt-screen as the explicit opt-outs.

Also trim the config docs and schema so they no longer describe Zellij-specific detection.
@fcoury-oai fcoury-oai changed the title Remove Zellij TUI workarounds feat(tui): remove Zellij TUI workarounds May 12, 2026
Copy link
Copy Markdown
Collaborator

@etraut-openai etraut-openai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good from a config standpoint. Doesn't change any config logic; just updates some description strings.

@fcoury-oai fcoury-oai merged commit 6f77b70 into main May 13, 2026
38 of 39 checks passed
@fcoury-oai fcoury-oai deleted the fcoury/remove-zellij-workaround branch May 13, 2026 15:11
@github-actions github-actions Bot locked and limited conversation to collaborators May 13, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants