Repository navigation
feat(close): warn before closing sessions that are still running - #191
Merged
Merged
Conversation
…ning Closing the window while a session is busy now lists those sessions (accent, name, why) and asks; "Keep running" is the default for Enter and Esc. Busy (Services/SessionBusyRules, WPF-free, unit-tested): - OSC 7501 sessions: working (+progress) or blocked mid-turn - other sessions: PTY output within the last 4s - any session with a running run command Skipped when the new WarnOnCloseWhenBusy setting is off (Settings, or the dialog's "Don't warn me again") and when Windows is logging off. UI test CloseWarningTests drives both answers with a `ping -t` session. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NsYm9iLc2aRnRDfV2uZRQX
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NsYm9iLc2aRnRDfV2uZRQX
… menus too Ctrl+W, the sidebar and toolbar ✕, the per-session "Close (N)" menu and both "Close all…" items now go through RequestCloseSession(s) → ConfirmCloseBusy, the same check and dialog as app close. "Close all…" asks one question: the busy dialog when something is busy, else its old Yes/No. Worktree removal keeps calling CloseCommand directly (it has its own confirmation). UI test also checks the pane ✕; CloseFirstSession confirms the dialog when a test session is still printing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NsYm9iLc2aRnRDfV2uZRQX
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Closing the app — or closing sessions with Ctrl+W, the sidebar/toolbar ✕, Close (N) or either Close all… — while something is still running now lists the busy sessions (accent, name, why) and asks. Keep running is the default for Enter and Esc; closing needs a click on Close anyway. Same look as the shutdown board, as an owned dialog (an overlay can't be drawn over the WebView2 panes without collapsing the grid).
Busy (
Services/SessionBusyRules, WPF-free, unit-tested):working(+progress) orblockedmid-turn — judged by the report onlySessionViewModel.NoteOutput, lock-free)"Close all…" asks one question: the busy dialog when something is busy, otherwise its old Yes/No. Worktree removal keeps its own confirmation.
Off via Settings (Warn before closing sessions that are still running) or the dialog's "Don't warn me again". Never shown when Windows is logging off.
Tests
SessionBusyRulesTests(15)CloseWarningTests: aping -tsession; pane ✕ → Keep running keeps it; app close → Keep running keeps the app; Close anyway exits.AppActions.CloseFirstSessionconfirms the dialog when a test session is still printing;AppFixturekills a process left asking.Not yet checked by hand
Closing a Claude session mid-prompt with Ctrl+W in the real app.
🤖 Generated with Claude Code
https://claude.ai/code/session_01NsYm9iLc2aRnRDfV2uZRQX