diff --git a/src/apprt/gtk/App.zig b/src/apprt/gtk/App.zig index e3cffde96..86a001cba 100644 --- a/src/apprt/gtk/App.zig +++ b/src/apprt/gtk/App.zig @@ -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); }, } } diff --git a/src/config/Config.zig b/src/config/Config.zig index da39e84ac..cb0b80ef9 100644 --- a/src/config/Config.zig +++ b/src/config/Config.zig @@ -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 } },