gtk-ng: implement close_tab:other keybind

pull/8403/head
Jeffrey C. Ollie 2025-08-26 12:22:45 -05:00
parent 5c464e855d
commit 6f630a27be
No known key found for this signature in database
GPG Key ID: 6F86035A6D97044E
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 &.{.{