mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-10-04 00:46:33 +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:
@@ -146,6 +146,7 @@ extension Ghostty {
|
||||
userdata: Unmanaged.passUnretained(self).toOpaque(),
|
||||
supports_selection_clipboard: false,
|
||||
wakeup_cb: { userdata in AppState.wakeup(userdata) },
|
||||
open_config_cb: { userdata in AppState.openConfig(userdata) },
|
||||
reload_config_cb: { userdata in AppState.reloadConfig(userdata) },
|
||||
set_title_cb: { userdata, title in AppState.setTitle(userdata, title: title) },
|
||||
set_mouse_shape_cb: { userdata, shape in AppState.setMouseShape(userdata, shape: shape) },
|
||||
@@ -267,6 +268,11 @@ extension Ghostty {
|
||||
NSApplication.shared.terminate(nil)
|
||||
}
|
||||
|
||||
func openConfig() {
|
||||
guard let app = self.app else { return }
|
||||
ghostty_app_open_config(app)
|
||||
}
|
||||
|
||||
func reloadConfig() {
|
||||
guard let app = self.app else { return }
|
||||
ghostty_app_reload_config(app)
|
||||
@@ -489,6 +495,10 @@ extension Ghostty {
|
||||
)
|
||||
}
|
||||
|
||||
static func openConfig(_ userdata: UnsafeMutableRawPointer?) {
|
||||
ghostty_config_open();
|
||||
}
|
||||
|
||||
static func reloadConfig(_ userdata: UnsafeMutableRawPointer?) -> ghostty_config_t? {
|
||||
guard let newConfig = Self.loadConfig() else {
|
||||
AppDelegate.logger.warning("failed to reload configuration")
|
||||
|
Reference in New Issue
Block a user