gtk-ng: implement close_tab:other keybind (#8403)

pull/7185/head
Mitchell Hashimoto 2025-08-26 10:48:55 -07:00 committed by GitHub
commit ff61cad1e2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 12 additions and 23 deletions

View File

@ -353,7 +353,7 @@ pub const Tab = extern struct {
// a close-page signal that the parent can intercept.
switch (mode) {
.this => tab_view.closePage(page),
.other => log.warn("close-tab:other is not implemented", .{}),
.other => tab_view.closeOtherPages(page),
}
}

View File

@ -558,8 +558,6 @@ pub const Action = union(enum) {
///
/// If the mode is not specified, defaults to closing the current tab.
///
/// close-tab:other is only available on macOS.
///
/// This might trigger a close confirmation popup, depending on the value
/// of the `confirm-close-surface` configuration setting.
close_tab: CloseTabMode,

View File

@ -393,8 +393,7 @@ fn actionCommands(action: Action.Key) []const Command {
.description = "Close the current terminal.",
}},
.close_tab => comptime if (builtin.target.os.tag.isDarwin())
&.{
.close_tab => comptime &.{
.{
.action = .{ .close_tab = .this },
.title = "Close Tab",
@ -405,14 +404,6 @@ fn actionCommands(action: Action.Key) []const Command {
.title = "Close Other Tabs",
.description = "Close all tabs in this window except the current one.",
},
}
else
&.{
.{
.action = .{ .close_tab = .this },
.title = "Close Tab",
.description = "Close the current tab.",
},
},
.close_window => comptime &.{.{