Gostty
April 19, 2026 · View on GitHub
ghostty-org/ghostty が提供するターミナルエンジン libghostty を cgo 経由で Go から呼び出し、GUIフレームワーク guigui-gui/guigui で描画することでターミナルを実装します。
モチベーション
- EbutenigeぷちConfで知ったguigui を使ってみたい
- Go からlibghosttyを使えるか試してみたい
技術スタック
- guigui:GUIフレームワーク
- 内部でEbitengineを使用
- libghostty:ghosttyを外部から利用するための仕組み
ローカルビルドと実行(macOS Apple Silicon)
前提
- macOS (Apple Silicon)
- mise —
mise.toml経由でzig 0.15.2を解決 - Go(
go.modのgo 1.25.0以上) - Xcode Command Line Tools と Metal Toolchain
手順
-
submodule を取得
git submodule update --init --recursive -
zig をセットアップ(プロジェクトルートで)
mise install -
Xcode の初回起動セットアップ(必要な場合のみ)
sudo xcodebuild -runFirstLaunch -
ghostty 静的ライブラリをビルド
cd ghostty zig build -Dapp-runtime=none -Doptimize=ReleaseSafe cd ..成果物:
ghostty/macos/GhosttyKit.xcframework/macos-arm64_x86_64/ghostty-internal.a -
gostty バイナリをビルドして実行
go build -o gostty ./cmd/terminal ./gostty