macos: respect window-new-tab-position configuration

This commit is contained in:
Thorsten Ball
2024-01-12 20:22:53 +01:00
parent a925afae84
commit 90427a8d22
2 changed files with 20 additions and 3 deletions

View File

@@ -84,6 +84,16 @@ extension Ghostty {
guard let ptr = v else { return "" }
return String(cString: ptr)
}
/// window-new-tab-position
var windowNewTabPosition: String {
guard let config = self.config else { return "" }
var v: UnsafePointer<Int8>? = nil
let key = "window-new-tab-position"
guard ghostty_config_get(config, &v, key, UInt(key.count)) else { return "" }
guard let ptr = v else { return "" }
return String(cString: ptr)
}
/// True if we need to confirm before quitting.
var needsConfirmQuit: Bool {