Skip to content

Remove AliveGuard from dynamic paging quit-if-one-screen#2

Draft
Copilot wants to merge 1 commit into
auto_quit_dynamic_paging_explicitfrom
copilot/drop-alive-guard-dynamic-paging
Draft

Remove AliveGuard from dynamic paging quit-if-one-screen#2
Copilot wants to merge 1 commit into
auto_quit_dynamic_paging_explicitfrom
copilot/drop-alive-guard-dynamic-paging

Conversation

Copy link
Copy Markdown

Copilot AI commented Apr 19, 2026

The quit_if_one_screen auto-exit in dynamic paging was triggered by two mechanisms: an explicit end_of_output() call and an implicit drop-based signal via AliveGuard. The implicit path added complexity and a subtle ref-count dance in dynamic_paging. Drop the implicit mechanism entirely; end_of_output() is the sole signal.

Changes

  • src/pager.rs — Remove AliveGuard struct, its Drop impl, and the alive: Arc<AliveGuard> field from Pager. Simplify Clone and new(). Update set_quit_if_one_screen docs to document only end_of_output() as the end-of-stream signal.
  • src/dynamic_pager.rs — Remove the workaround pager_for_init construction (which existed solely to hold an independent AliveGuard Arc). dynamic_paging now passes the pager directly to init_core.

Before

// Two paths to trigger CheckQuitIfOneScreen:
pager.end_of_output().unwrap();   // explicit
drop(pager);                       // implicit via AliveGuard::drop

After

// Only one path:
pager.end_of_output().unwrap();

Agent-Logs-Url: https://github.com/forkeith/minus/sessions/6ad07131-4482-4d7e-83e6-fd6ab6ec33a4

Co-authored-by: keith-hall <11882719+keith-hall@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants