Repository navigation
Description
Priority: P1 | Area: runtime | Labels: fix, P1, area:runtime | Milestone: v0.1.0 | RFC: Pane!=PTY | Related: #3199 (PR #3200)
Summary
After #3200 made a plugin-created Dwindle panel a first-class zero-PTY leaf, the app's exit
condition still treats "no PTY session" as "nothing left to show".
crates/bitty-terminal/src/terminal_app.rs (~line 4817) computes the exit reason from
pane_session_count(). With one primary shell plus one live plugin panel
(PanelType::Rich/Helper, zero PTY sessions of its own), the count reaches zero when the
primary shell exits, the app returns AppExiting, and the event handler destroys the window
together with the still-live plugin panel — its declarative scene and panel record go with it.
This contradicts the accepted Panel-outlives-PTY direction: a Panel is a workspace leaf that
outlives its runtime session, and a zero-PTY leaf is not inert.
Scope
- Make the exit decision account for live leaves that own no PTY session (plugin panels,
rich content) instead ofpane_session_count()alone. - Preserve today's behaviour when nothing live remains (last shell exits with no panels ⇒ the
window still closes; do not turn this into "app never exits"). - Cover the three shapes with tests: shell only, shell + live plugin panel, plugin panel only.
- Decide explicitly (and record it) whether a window whose only remaining leaf is a plugin
panel keeps running or closes — the UX reference rule (ghostty/kitty close the window when
the shell exits) and the Panel-outlives-PTY invariant pull in opposite directions here, so
the decision belongs in the terminal-platform docs, not in an ad-hoc condition.
Evidence
- CodeRabbit review on PR [CTX-1859] feat(runtime,terminal): plugin-owned Dwindle panels with panel-scoped UI mount and focus input routing #3200 (head
2976fa4e), "Outside diff range comments (1) — Major:
Keep live plugin panels open when the primary shell exits",terminal_app.rs:4817. - Independent review of PR [CTX-1859] feat(runtime,terminal): plugin-owned Dwindle panels with panel-scoped UI mount and focus input routing #3200 verified every close path removes the leaf and disposes the
record, but did not examine this exit path; the defect is therefore real and untested, not
a duplicate of the residuals listed on the PR.
Activity