feat(macos): foundation of the macOS app ported from Swift to Rust

Phase 9, MA1: crates/ghostty-macos (AppKit via objc2; empty stub on
non-Apple targets) ports the foundation of Ghostty 1.3.1's Swift macOS
app (ghostty/macos): main, AppDelegate (+Ghostty) with lifecycle, dock
menu, open-file, notifications, shortcut sync and quit/reopen paths;
MainMenu.xib as generated menu tables built into NSMenus; the
Ghostty.App/Config/Surface wrappers driving libghostty in-process via
ghostty-lib; the generic helpers; scripts/macos-bundle.sh to assemble
Ghostty.app (dry-run on Linux). Feature areas are stubbed for MA2-MA5.
Design and type mapping: docs/rewrite/notes/macos-app-design.md
(App Intents is a Swift-only framework and cannot be ported).

Compile-checked only (no macOS here): just check-macos passes for
aarch64/x86_64-apple-darwin with -D warnings; 125 platform-independent
tests run on Linux.

Test Plan:
- just check-macos
- cargo test -p ghostty-macos
This commit is contained in:
ddidderr committed 2026-10-12 19:25:44 +02:00
1 parent fb79cc8d5c
commit 0137168c66
112 files changed
+18438 -2

No files matched your search

+10 -1
View File
@@ -5,6 +5,8 @@
# Usage: scripts/macos-crosscheck.sh [check|clippy] [target]
# MACOS_CHECK_FEATURES="ghostty-font/font-backend-freetype" adds cargo features
# (for example the FreeType-only font backend on Apple).
# MACOS_CHECK_ONLY="ghostty-macos" restricts the check to the given crates
# (space separated), for quick iteration.
set -euo pipefail
cd "$(dirname "$0")/.."
MODE=${1:-clippy}
@@ -55,13 +57,20 @@ export GETTEXT_DIR=/nonexistent ZIG_GLOBAL_CACHE_DIR="$W/zig-cache" ZIG_LOCAL_CA
CRATES=(-p ghostty-vt -p ghostty-unicode -p ghostty-datastruct -p ghostty-os -p ghostty-input
-p ghostty-config -p ghostty-terminal -p ghostty-font -p ghostty-renderer -p ghostty-termio
-p ghostty-core -p ghostty-apprt -p ghostty-inspector -p ghostty-lib -p ghostty-crash
-p ghostty-bench -p ghostty-vt-capi)
-p ghostty-bench -p ghostty-vt-capi -p ghostty-macos)
if [ -n "${MACOS_CHECK_ONLY:-}" ]; then
CRATES=()
for c in $MACOS_CHECK_ONLY; do CRATES+=(-p "$c"); done
fi
FEATURES=()
if [ -n "${MACOS_CHECK_FEATURES:-}" ]; then
FEATURES=(--features "$MACOS_CHECK_FEATURES")
fi
if [ "$MODE" = clippy ]; then
cargo clippy --target "$TARGET" "${CRATES[@]}" "${FEATURES[@]}" --lib --tests -- -D warnings
# The macOS app executable (an Apple-only binary).
cargo clippy --target "$TARGET" -p ghostty-macos --bins -- -D warnings
else
cargo check --target "$TARGET" "${CRATES[@]}" "${FEATURES[@]}" --lib --tests
cargo check --target "$TARGET" -p ghostty-macos --bins
fi