mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-15 00:06:09 +03:00
Merge pull request #1087 from mitchellh/close-quit
core: quit-after-last-window-closed works properly with "exit"
This commit is contained in:
@ -103,8 +103,8 @@ pub fn tick(self: *App, rt_app: *apprt.App) !bool {
|
|||||||
// doesn't want to quit, then we can't force it to.
|
// doesn't want to quit, then we can't force it to.
|
||||||
defer self.quit = false;
|
defer self.quit = false;
|
||||||
|
|
||||||
// We quit if our quit flag is on or if we have closed all surfaces.
|
// We quit if our quit flag is on
|
||||||
return self.quit or self.surfaces.items.len == 0;
|
return self.quit;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Update the configuration associated with the app. This can only be
|
/// Update the configuration associated with the app. This can only be
|
||||||
|
@ -111,7 +111,7 @@ pub const App = struct {
|
|||||||
|
|
||||||
// Tick the terminal app
|
// Tick the terminal app
|
||||||
const should_quit = try self.app.tick(self);
|
const should_quit = try self.app.tick(self);
|
||||||
if (should_quit) {
|
if (should_quit or self.app.surfaces.items.len == 0) {
|
||||||
for (self.app.surfaces.items) |surface| {
|
for (self.app.surfaces.items) |surface| {
|
||||||
surface.close(false);
|
surface.close(false);
|
||||||
}
|
}
|
||||||
|
@ -316,7 +316,7 @@ pub fn run(self: *App) !void {
|
|||||||
|
|
||||||
// Tick the terminal app
|
// Tick the terminal app
|
||||||
const should_quit = try self.core_app.tick(self);
|
const should_quit = try self.core_app.tick(self);
|
||||||
if (should_quit) self.quit();
|
if (should_quit or self.core_app.surfaces.items.len == 0) self.quit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user