Skip to content

fix(panel): never auto-close panels on child exit#185

Merged
peters merged 1 commit intomainfrom
fix/keep-panel-open-on-clean-exit
May 7, 2026
Merged

fix(panel): never auto-close panels on child exit#185
peters merged 1 commit intomainfrom
fix/keep-panel-open-on-clean-exit

Conversation

@peters
Copy link
Copy Markdown
Owner

@peters peters commented May 6, 2026

Summary

  • A clean child exit (exit code 0) still auto-removed the panel: exit in a shell, Ctrl-D / /exit in an agent, or any successful one-shot command would make the panel vanish.
  • PR fix(panel): keep panels open when child process fails or exits non-zero #180 already kept failure exits open; this finishes the job for the success case so the panel is never closed automatically. The user always closes panels manually via the X or the "Close" context menu item.
  • Drops the now-unused machinery: Panel::should_close_after_exit, the should_close_for_exit_status helper, Board::exited_panels, and the lifecycle loop that fed exited ids into panels_to_close.
  • SSH "Reconnect" still works: SSH panels were already exempted from auto-close, and child_exited() (used to flip SshConnectionStatus::Disconnected) is untouched.

Test plan

  • Open a Shell panel, type exit, confirm the panel stays open and can be closed via the X.
  • Open a Claude panel, run /exit (or Ctrl-C then exit), confirm the panel stays open.
  • Open a Command panel that runs a short-lived script (e.g. echo hi), confirm the panel stays open after the command finishes.
  • Open an SSH panel, terminate the connection (exit), confirm the panel stays open and Reconnect still works.
  • Click the X / Close menu item on each, confirm manual close works as before.

Previously a clean process exit (exit code 0, e.g. typing `exit` in a shell
or Ctrl-D / Ctrl-C-then-exit in an agent) auto-removed the panel. PR #180
already kept failed exits open; this finishes the job for the success
case so the user always closes panels manually via the X button or the
"Close" context menu item.

Drops the `should_close_after_exit` / `should_close_for_exit_status`
machinery and `Board::exited_panels`, plus the lifecycle hook that fed
exited ids into `panels_to_close`.

SSH "Reconnect" still works: SSH panels were already exempted from
auto-close, and the `child_exited()` flag (used to flip
`SshConnectionStatus` to `Disconnected`) is untouched.
@peters peters merged commit 9b5b28a into main May 7, 2026
13 checks passed
@peters peters deleted the fix/keep-panel-open-on-clean-exit branch May 7, 2026 18:39
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.

1 participant