macos: add "Close Split" to right-click context menu
Add a "Close Split" option to the right-click context menu, allowing users to close the focused split pane directly from the context menu. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>pull/11174/head
parent
46522a8779
commit
3b27318510
|
|
@ -1485,6 +1485,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: "")
|
||||
|
|
@ -1628,6 +1631,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"
|
||||
|
|
|
|||
Loading…
Reference in New Issue