Close other tabs feature on Mac.

Supporting command line, file menu and keybindings.
Default mac shortcut of `super + alt + o` (other)

Not able to test on Linux so excluding `close_other_tabs` from `gtk` for now
make a default short cut for close other tabs
This commit is contained in:
jamylak
2025-08-23 14:41:01 +10:00
committed by Mitchell Hashimoto
parent 13425b4881
commit c26323d697
13 changed files with 160 additions and 11 deletions

View File

@@ -558,6 +558,12 @@ pub const Action = union(enum) {
/// of the `confirm-close-surface` configuration setting.
close_tab,
/// Close all tabs other than the currently focused one within the same
/// window.
///
/// Only available on macOS currently.
close_other_tabs,
/// Close the current window and all tabs and splits therein.
///
/// This might trigger a close confirmation popup, depending on the value
@@ -1052,6 +1058,7 @@ pub const Action = union(enum) {
.write_selection_file,
.close_surface,
.close_tab,
.close_other_tabs,
.close_window,
.toggle_maximize,
.toggle_fullscreen,

View File

@@ -375,6 +375,12 @@ fn actionCommands(action: Action.Key) []const Command {
.description = "Show the on-screen keyboard if present.",
}},
.close_other_tabs => comptime &.{.{
.action = .close_other_tabs,
.title = "Close Other Tabs",
.description = "Close all tabs in this window except the current one.",
}},
.open_config => comptime &.{.{
.action = .open_config,
.title = "Open Config",