macos: add a macos-shortcut config

This commit is contained in:
Mitchell Hashimoto
2025-06-20 11:54:19 -07:00
parent 647f29bad1
commit b6559d0899
3 changed files with 68 additions and 1 deletions

View File

@@ -558,6 +558,17 @@ extension Ghostty {
_ = ghostty_config_get(config, &v, key, UInt(key.count))
return v
}
var macosShortcuts: MacShortcuts {
let defaultValue = MacShortcuts.ask
guard let config = self.config else { return defaultValue }
var v: UnsafePointer<Int8>? = nil
let key = "macos-shortcuts"
guard ghostty_config_get(config, &v, key, UInt(key.count)) else { return defaultValue }
guard let ptr = v else { return defaultValue }
let str = String(cString: ptr)
return MacShortcuts(rawValue: str) ?? defaultValue
}
}
}
@@ -584,6 +595,12 @@ extension Ghostty.Config {
case always
}
enum MacShortcuts: String {
case allow
case deny
case ask
}
enum ResizeOverlay : String {
case always
case never