pull/11174/merge
Caleb Wetherell 2026-06-02 04:04:01 +08:00 committed by GitHub
commit 8d7c66dfc0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 11 additions and 0 deletions

View File

@ -1576,6 +1576,9 @@ extension Ghostty {
item.setImageIfDesired(systemSymbolName: "rectangle.bottomhalf.inset.filled")
item = menu.addItem(withTitle: "Split Up", action: #selector(splitUp(_:)), keyEquivalent: "")
item.setImageIfDesired(systemSymbolName: "rectangle.tophalf.inset.filled")
menu.addItem(.separator())
item = menu.addItem(withTitle: "Close Split", action: #selector(closeSurface(_:)), keyEquivalent: "")
item.setImageIfDesired(systemSymbolName: "xmark.rectangle")
menu.addItem(.separator())
item = menu.addItem(withTitle: "Reset Terminal", action: #selector(resetTerminal(_:)), keyEquivalent: "")
@ -1703,6 +1706,14 @@ extension Ghostty {
ghostty_surface_split(surface, GHOSTTY_SPLIT_DIRECTION_UP)
}
@IBAction func closeSurface(_ sender: Any?) {
guard let surface = self.surface else { return }
let action = "close_surface"
if !ghostty_surface_binding_action(surface, action, UInt(action.lengthOfBytes(using: .utf8))) {
AppDelegate.logger.warning("action failed action=\(action)")
}
}
@objc func resetTerminal(_ sender: Any) {
guard let surface = self.surface else { return }
let action = "reset"