diff options
| author | Jeffrey C. Ollie <jeff@ocjtech.us> | 2025-08-25 11:00:26 -0500 |
|---|---|---|
| committer | Jeffrey C. Ollie <jeff@ocjtech.us> | 2025-08-25 11:00:26 -0500 |
| commit | 52a25e9c696a85c36d2e9bbf65e467e6deb8b28b (patch) | |
| tree | 3b26ca2b79148bd5e8a5e262cf8da7c69dbe1bac /src/input/command.zig | |
| parent | 8aa0b4c92a54f822043e134d2b84ee29844f944e (diff) | |
parameterize close_tab
- Add mode (`this`/`other`) parameter to `close_tab` keybind/apprt action.
- Keybinds will default to `this` if not specified, eliminating backward
compatibility issues (`keybind=x=close_tab` === `keybind=x=close_tab:this`).
- Remove `close_other_tabs` keybind and apprt action.
Diffstat (limited to 'src/input/command.zig')
| -rw-r--r-- | src/input/command.zig | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/src/input/command.zig b/src/input/command.zig index 68652cce3..f6c29040a 100644 --- a/src/input/command.zig +++ b/src/input/command.zig @@ -375,12 +375,6 @@ 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", @@ -399,11 +393,27 @@ fn actionCommands(action: Action.Key) []const Command { .description = "Close the current terminal.", }}, - .close_tab => comptime &.{.{ - .action = .close_tab, - .title = "Close Tab", - .description = "Close the current tab.", - }}, + .close_tab => comptime if (builtin.target.os.tag.isDarwin()) + &.{ + .{ + .action = .{ .close_tab = .this }, + .title = "Close Tab", + .description = "Close the current tab.", + }, + .{ + .action = .{ .close_tab = .other }, + .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 &.{.{ .action = .close_window, |
