feat(web): make the terminal close confirmation optional - #164
Conversation
Upstream added the confirmation unconditionally, so every single terminal close prompts. Add a `confirmTerminalClose` client setting (default true, so behavior is unchanged) with a Settings -> General switch beside the archive and delete confirmations. The gate lives in `confirmTerminalClose()` itself, so all four call sites keep working untouched. Model: claude-opus-5, harness: Claude Code.
Review caught a cold-start race: the pre-hydration snapshot is the schema default, so closing a restored terminal early in startup prompted even when the user had turned the prompt off. Await ensureClientSettingsHydrated() first, matching resolveBrowserDefaults.
|
Review pass (gpt-5.6-sol) findings and dispositions: Fixed — pre-hydration race in Declined — a Declined — extracting a shared boolean-setting row or a descriptor list for the three confirmation switches. Real duplication, but it would refactor upstream-owned code in Declined — rebuilding Not this PR — cross-tab snapshot staleness and hydration overwriting an in-flight switch update. Both are properties of the shared client-settings store and affect every setting equally. |
Upstream's terminal close confirmation (pingdotgg#7592) fires on every individual close with no way to turn it off, so closing a terminal always costs a dialog.
Adds a
confirmTerminalCloseclient setting that defaults to true, keeping upstream behavior for anyone who doesn't touch it, plus a switch in Settings → General next to the archive and delete confirmations. The gate sits insideconfirmTerminalClose()and reads the non-hookgetClientSettings()snapshot, so all four call sites (drawer button, panel button,terminal.closekeybinding, tab-strip close) stay untouched. Before client settings hydrate the snapshot holds the schema default, so the pre-hydration answer is still to ask.Bulk tab closes and auto-exit cleanup never went through this path and still don't.
Verified with
vp check,vp run typecheck, and focused tests for the confirm helper, settings search, client settings, and desktop client settings. The new "setting off" test was mutation-checked: removing the gate fails it.Model: claude-opus-5, harness: Claude Code.