mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-04-19 14:00:29 +00:00
Add settings shortcut on MacOS
- Settings shortcut opens the config file in the default editor. Signed-off-by: Borja Clemente <borja.clemente@gmail.com>
This commit is contained in:
10
src/App.zig
10
src/App.zig
@@ -186,6 +186,7 @@ fn drainMailbox(self: *App, rt_app: *apprt.App) !void {
|
||||
log.debug("mailbox message={s}", .{@tagName(message)});
|
||||
switch (message) {
|
||||
.reload_config => try self.reloadConfig(rt_app),
|
||||
.open_config => try self.openConfig(rt_app),
|
||||
.new_window => |msg| try self.newWindow(rt_app, msg),
|
||||
.close => |surface| try self.closeSurface(surface),
|
||||
.quit => try self.setQuit(),
|
||||
@@ -196,6 +197,12 @@ fn drainMailbox(self: *App, rt_app: *apprt.App) !void {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn openConfig(self: *App, rt_app: *apprt.App) !void {
|
||||
_ = self;
|
||||
log.debug("opening configuration", .{});
|
||||
try rt_app.openConfig();
|
||||
}
|
||||
|
||||
pub fn reloadConfig(self: *App, rt_app: *apprt.App) !void {
|
||||
log.debug("reloading configuration", .{});
|
||||
if (try rt_app.reloadConfig()) |new| {
|
||||
@@ -274,6 +281,9 @@ pub const Message = union(enum) {
|
||||
/// all the active surfaces.
|
||||
reload_config: void,
|
||||
|
||||
// Open the configuration file
|
||||
open_config: void,
|
||||
|
||||
/// Create a new terminal window.
|
||||
new_window: NewWindow,
|
||||
|
||||
|
||||
Reference in New Issue
Block a user