mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-04-14 03:25:50 +00:00
macos: Add AppleScript commands for window and tab control
Add scripting dictionary commands for activating windows, selecting tabs, closing tabs, and closing windows. Implement the corresponding Cocoa AppleScript command handlers and expose minimal ScriptWindow/ScriptTab helpers needed to resolve live targets. Verified by building Ghostty and running osascript commands against the absolute Debug app path to exercise all four new commands.
This commit is contained in:
@@ -63,6 +63,16 @@ final class ScriptTab: NSObject {
|
||||
return window?.tabIsSelected(controller) ?? false
|
||||
}
|
||||
|
||||
/// Best-effort native window containing this tab.
|
||||
var parentWindow: NSWindow? {
|
||||
controller?.window
|
||||
}
|
||||
|
||||
/// Live controller backing this tab wrapper.
|
||||
var parentController: BaseTerminalController? {
|
||||
controller
|
||||
}
|
||||
|
||||
/// Exposed as the AppleScript `terminals` element on a tab.
|
||||
///
|
||||
/// Returns all terminal surfaces (split panes) within this tab.
|
||||
|
||||
Reference in New Issue
Block a user