mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-08-02 14:57:31 +03:00
close_tab keybind implemented. default set.
This commit is contained in:

committed by
Mitchell Hashimoto

parent
68a8c05f19
commit
1c8c82ee5a
@ -537,15 +537,15 @@ fn closeTab(_: *App, target: apprt.Target) !void {
|
||||
switch (target) {
|
||||
.app => {},
|
||||
.surface => |v| {
|
||||
const window = v.rt_surface.container.window() orelse {
|
||||
const tab = v.rt_surface.container.tab() orelse {
|
||||
log.info(
|
||||
"close_tab invalid for container={s}",
|
||||
.{@tagName(v.rt_surface.container)},
|
||||
);
|
||||
return;
|
||||
};
|
||||
// TODO: get tab from surface
|
||||
try window.closeTab(v);
|
||||
|
||||
tab.window.closeTab(tab);
|
||||
},
|
||||
}
|
||||
}
|
||||
|
@ -2373,6 +2373,11 @@ pub fn default(alloc_gpa: Allocator) Allocator.Error!Config {
|
||||
.{ .key = .{ .translated = .t }, .mods = .{ .ctrl = true, .shift = true } },
|
||||
.{ .new_tab = {} },
|
||||
);
|
||||
try result.keybind.set.put(
|
||||
alloc,
|
||||
.{ .key = .{ .translated = .x }, .mods = .{ .ctrl = true, .shift = true } },
|
||||
.{ .close_tab = {} },
|
||||
);
|
||||
try result.keybind.set.put(
|
||||
alloc,
|
||||
.{ .key = .{ .translated = .left }, .mods = .{ .ctrl = true, .shift = true } },
|
||||
@ -2653,6 +2658,11 @@ pub fn default(alloc_gpa: Allocator) Allocator.Error!Config {
|
||||
.{ .key = .{ .translated = .t }, .mods = .{ .super = true } },
|
||||
.{ .new_tab = {} },
|
||||
);
|
||||
try result.keybind.set.put(
|
||||
alloc,
|
||||
.{ .key = .{ .translated = .x }, .mods = .{ .super = true } },
|
||||
.{ .close_tab = {} },
|
||||
);
|
||||
try result.keybind.set.put(
|
||||
alloc,
|
||||
.{ .key = .{ .translated = .left_bracket }, .mods = .{ .super = true, .shift = true } },
|
||||
|
Reference in New Issue
Block a user