mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-04-06 07:38:21 +00:00
1.6 KiB
1.6 KiB
macOS Ghostty Application
- Use
swiftlintfor formatting and linting Swift code. - If code outside of
macos/directory is modified, usezig build -Demit-macos-app=falsebefore building the macOS app to update the underlying Ghostty library. - Use
macos/build.nuto build the macOS app, do not usezig 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)
- Build:
- Run unit tests directly with
macos/build.nu --action test
AppleScript
- The AppleScript scripting definition is in
macos/Ghostty.sdef. - Guard AppleScript entry points and object accessors with the
macos-applescriptconfiguration (useNSApp.isAppleScriptEnabledandNSApp.validateScript(command:)where applicable). - In
macos/Ghostty.sdef, keep top-level definitions in this order:- Classes
- Records
- Enums
- 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 withosascript, 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'