mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-17 01:06:08 +03:00
close window action
This commit is contained in:
@ -764,6 +764,8 @@ fn keyCallback(
|
|||||||
}, .{ .instant = {} });
|
}, .{ .instant = {} });
|
||||||
win.app.wakeup();
|
win.app.wakeup();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
.close_window => win.window.setShouldClose(true),
|
||||||
}
|
}
|
||||||
|
|
||||||
// Bindings always result in us ignoring the char if printable
|
// Bindings always result in us ignoring the char if printable
|
||||||
|
@ -159,9 +159,14 @@ pub const Config = struct {
|
|||||||
|
|
||||||
try result.keybind.set.put(
|
try result.keybind.set.put(
|
||||||
alloc,
|
alloc,
|
||||||
.{ .key = .up, .mods = .{ .super = true } },
|
.{ .key = .n, .mods = .{ .super = true } },
|
||||||
.{ .new_window = {} },
|
.{ .new_window = {} },
|
||||||
);
|
);
|
||||||
|
try result.keybind.set.put(
|
||||||
|
alloc,
|
||||||
|
.{ .key = .w, .mods = .{ .super = true } },
|
||||||
|
.{ .close_window = {} },
|
||||||
|
);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -134,8 +134,11 @@ pub const Action = union(enum) {
|
|||||||
/// Dev mode
|
/// Dev mode
|
||||||
toggle_dev_mode: void,
|
toggle_dev_mode: void,
|
||||||
|
|
||||||
/// Open a new terminal window.
|
/// Open a new window
|
||||||
new_window: void,
|
new_window: void,
|
||||||
|
|
||||||
|
/// Close the current window
|
||||||
|
close_window: void,
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Trigger is the associated key state that can trigger an action.
|
/// Trigger is the associated key state that can trigger an action.
|
||||||
|
Reference in New Issue
Block a user