From ef669eeae7574335631d6897c07f60ce4015727c Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Thu, 5 Mar 2026 20:46:52 -0800 Subject: [PATCH] macos: add AppleScript `split` command Add a new `split` command to the AppleScript scripting dictionary that splits a terminal in a given direction (right, left, down, up) and returns the newly created terminal. The command is exposed as: split terminal direction Also adds a `fourCharCode` String extension for converting four-character ASCII strings to their FourCharCode (UInt32) representation. --- macos/Ghostty.sdef | 19 +++++ macos/Ghostty.xcodeproj/project.pbxproj | 3 +- .../AppleScript/ScriptSplitCommand.swift | 74 +++++++++++++++++++ ...iptTerminal.swift => ScriptTerminal.swift} | 5 +- .../Helpers/Extensions/String+Extension.swift | 9 +++ 5 files changed, 108 insertions(+), 2 deletions(-) create mode 100644 macos/Sources/Features/AppleScript/ScriptSplitCommand.swift rename macos/Sources/Features/AppleScript/{AppleScriptTerminal.swift => ScriptTerminal.swift} (90%) diff --git a/macos/Ghostty.sdef b/macos/Ghostty.sdef index 9ed37f764..962e1329a 100644 --- a/macos/Ghostty.sdef +++ b/macos/Ghostty.sdef @@ -8,6 +8,7 @@ + @@ -25,6 +26,24 @@ + + + + + + + + + + + + + + + + + +