Repository navigation
fix: set alt_screen_enabled before resume/fork pickers run - #9258
hjanuschka wants to merge 1 commit into
Conversation
The alt_screen_enabled flag was being set AFTER resume_picker and fork_picker ran, which meant those overlays would enter alternate screen even when --no-alt-screen was passed or when running in Zellij. This moves the set_alt_screen_enabled() call to immediately after Tui::new(), before any pickers or overlays run, ensuring all enter_alt_screen() calls respect the setting. Fixes openai#9115
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 764d79ad0f
ℹ️ 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".
|
@hjanuschka thanks for the contribution. Please take a look at the code review feedback from Codex. |
|
Re: the P2 comments about recomputing alt-screen after config reload - Once the TUI has started in either mode (alt-screen or inline), switching mid-session isn't possible - the terminal state is committed and content may already be in scrollback. The early flag setting affects pickers/overlays, and by the time config reload happens after trust, we're already committed to whichever mode we started with. This is a theoretical edge case that doesn't affect real-world usage. Happy to add the recompute if you prefer, but wanted to note it's mostly theoretical. |
agreed |
|
ok after alot of testing, i am still working on a proper fix, tui2 works flawless, will continue over the weekend to figure out a fix for legacy tui! @etraut-openai can you put this on "on-hold" or somehow merge block? |
|
Thanks @hjanuschka! Can you set the PR to "draft" status in the meantime? |
|
@hjanuschka, checking in with you to see if you're making progress or anticipate having time to work on this soon? If not, we will close it for now. |
|
been playing around with it, works in flawless in tui2 but not in tui1, i just cant get it to work :( |
|
@hjanuschka, FYI, we've decided to abandon the tui2 approach. That tui2 code is removed from the main branch. |
|
I'm going to close the PR. If you want to pick it up again, we can reopen. |
|
hi @etraut-openai , do you have a solution for this issue? |
Summary
The
alt_screen_enabledflag was being set AFTERresume_pickerandfork_pickerran, which meant those overlays would enter alternate screen even when--no-alt-screenwas passed or when running in Zellij with auto-detection.This moves the
set_alt_screen_enabled()call to immediately afterTui::new(), before any pickers or overlays run, ensuring allenter_alt_screen()calls respect the setting.Before (broken order):
Tui::new()- alt_screen_enabled defaults totrueresume_picker::run_resume_picker()- enters alt screen (ignores flag!)tui.set_alt_screen_enabled(false)- too lateAfter (fixed order):
Tui::new()- alt_screen_enabled defaults totruetui.set_alt_screen_enabled(use_alt_screen)- set flag earlyresume_picker::run_resume_picker()- respects flagFixes #9115
Test plan
codex --no-alt-screenin Zellij and verify scrollback workscodex resumein Zellij and verify the picker also respects the settingcodexin a normal terminal and verify alternate screen still works