Files
ghostty/macos/AGENTS.md
Mitchell Hashimoto 459eaa2640 macos: order AppleScript dictionary definitions
Document the preferred Ghostty.sdef top-level order in AGENTS.md and reorder 
Ghostty Suite definitions to classes, records, enums, then commands.
2026-03-06 12:28:02 -08:00

1.4 KiB

macOS Ghostty Application

  • Use swiftlint for formatting and linting Swift code.
  • If code outside of macos/ directory is modified, use zig build -Demit-macos-app=false before building the macOS app to update the underlying Ghostty library.
  • Use macos/build.nu to build the macOS app, do not use zig build (except to build the underlying library as mentioned above).
    • Build: macos/build.nu [--scheme Ghostty] [--configuration Debug] [--action build]
    • Output: macos/build/<configuration>/Ghostty.app (e.g. macos/build/Debug/Ghostty.app)
  • Run unit tests directly with macos/build.nu --action test

AppleScript

  • The AppleScript scripting definition is in macos/Ghostty.sdef.
  • In macos/Ghostty.sdef, keep top-level definitions in this order:
    1. Classes
    2. Records
    3. Enums
    4. Commands
  • Test AppleScript support: (1) Build with macos/build.nu (2) Launch and activate the app via osascript using the absolute path to the built app bundle: osascript -e 'tell application "<absolute path to build/Debug/Ghostty.app>" to activate' (3) Wait a few seconds for the app to fully launch and open a terminal. (4) Run test scripts with osascript, always targeting the app by its absolute path (not by name) to avoid calling the wrong application. (5) When done, quit via: osascript -e 'tell application "<absolute path to build/Debug/Ghostty.app>" to quit'