mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-08-02 14:57:31 +03:00
reload_config keybinding (defaults to ctrl+alt+super+space)
This commit is contained in:
@ -135,7 +135,9 @@ fn drainMailbox(self: *App, rt_app: *apprt.App) !void {
|
||||
}
|
||||
|
||||
fn reloadConfig(self: *App, rt_app: *apprt.App) !void {
|
||||
log.debug("reloading configuration", .{});
|
||||
if (try rt_app.reloadConfig()) |new| {
|
||||
log.debug("new configuration received, applying", .{});
|
||||
try self.updateConfig(new);
|
||||
}
|
||||
}
|
||||
|
@ -852,6 +852,12 @@ pub fn keyCallback(
|
||||
.unbind => unreachable,
|
||||
.ignore => {},
|
||||
|
||||
.reload_config => {
|
||||
_ = self.app_mailbox.push(.{
|
||||
.reload_config = {},
|
||||
}, .{ .instant = {} });
|
||||
},
|
||||
|
||||
.csi => |data| {
|
||||
_ = self.io_thread.mailbox.push(.{
|
||||
.write_stable = "\x1B[",
|
||||
|
@ -239,6 +239,12 @@ pub const Config = struct {
|
||||
const alloc = result._arena.?.allocator();
|
||||
|
||||
// Add our default keybindings
|
||||
try result.keybind.set.put(
|
||||
alloc,
|
||||
.{ .key = .space, .mods = .{ .super = true, .alt = true, .ctrl = true } },
|
||||
.{ .reload_config = {} },
|
||||
);
|
||||
|
||||
{
|
||||
// On macOS we default to super but Linux ctrl+shift since
|
||||
// ctrl+c is to kill the process.
|
||||
|
@ -187,6 +187,12 @@ pub const Action = union(enum) {
|
||||
/// Focus on a split in a given direction.
|
||||
goto_split: SplitFocusDirection,
|
||||
|
||||
/// Reload the configuration. The exact meaning depends on the app runtime
|
||||
/// in use but this usually involves re-reading the configuration file
|
||||
/// and applying any changes. Note that not all changes can be applied at
|
||||
/// runtime.
|
||||
reload_config: void,
|
||||
|
||||
/// Close the current "surface", whether that is a window, tab, split,
|
||||
/// etc. This only closes ONE surface.
|
||||
close_surface: void,
|
||||
|
Reference in New Issue
Block a user