From 0e76a796851235409b068fa3d49c7fb9d29d5e86 Mon Sep 17 00:00:00 2001 From: l0ng-ai <24760907+l0ng-ai@users.noreply.github.com> Date: Wed, 22 Jul 2026 21:04:40 +0800 Subject: [PATCH] fix(window): quit when the last window is closed from the home page Closing the window with zero tabs took the early-return path in on_window_should_close, which skipped the cx.quit() the confirmed path runs. gpui does not quit on last-window-close and no on_reopen handler is registered, so the process stayed alive with no window and clicking the Dock icon did nothing (#147). Defer the quit onto the next tick so the close completes first, matching the confirmed path. --- src/ui/app.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/ui/app.rs b/src/ui/app.rs index e19592ed..8aed4b89 100644 --- a/src/ui/app.rs +++ b/src/ui/app.rs @@ -698,11 +698,20 @@ impl Tty7App { return true; } // From the home page (zero tabs) there are no running sessions to - // reassure about — prompting would be pure friction. Close directly. + // reassure about — prompting would be pure friction. Close directly, + // but still quit with the window: closing our only window without + // quitting leaves a windowless process sitting in the Dock that no + // longer responds to being clicked (#147). Deferred onto the next + // tick so the close itself completes first, same as the confirmed + // path below. if weak_app .upgrade() .is_some_and(|app| app.read(cx).tabs.is_empty()) { + cx.spawn(async move |cx| { + let _ = cx.update(|cx| cx.quit()); + }) + .detach(); return true; } let answer = window.prompt(