macos: add new tab command

This commit is contained in:
Mitchell Hashimoto
2026-03-06 12:37:51 -08:00
parent 4d5de702f2
commit d271c8ccaa
4 changed files with 96 additions and 0 deletions

View File

@@ -111,6 +111,11 @@ final class ScriptWindow: NSObject {
selectedController === controller
}
/// Best-effort native window to use as a tab parent for AppleScript commands.
var preferredParentWindow: NSWindow? {
selectedController?.window ?? controllers.first?.window
}
/// Resolves a previously generated tab ID back to a live controller.
private func controller(tabID: String) -> BaseTerminalController? {
controllers.first(where: { ScriptTab.stableID(controller: $0) == tabID })