cmux-ghostty

cmux-ghostty

热门

适用于 cmux 的 Ghostty 子模块与 GhosttyKit 工作流规范。当需要修改 ghostty 子模块、重新构建 GhosttyKit.xcframework、更新主项目中的子模块指针或记录 fork 冲突说明时使用。

2.5万Star
2120Fork
更新于 2026/8/1
SKILL.md
只读
名称
cmux-ghostty
描述

适用于 cmux 的 Ghostty 子模块与 GhosttyKit 工作流规范。当需要修改 ghostty 子模块、重新构建 GhosttyKit.xcframework、更新主项目中的子模块指针或记录 fork 冲突说明时使用。

cmux Ghostty

GhosttyKit 构建

构建 xcframework 时,务必开启 Release 优化选项:

cd ghostty && zig build -Demit-xcframework=true -Dxcframework-target=universal -Doptimize=ReleaseFast

子模块工作流

Ghostty 的修改需提交到 ghostty 子模块中,并推送至 manaflow-ai/ghostty fork 仓库。请保持 docs/ghostty-fork.md 内容最新,及时记录 fork 改动与冲突说明。

提交前务必先运行 git remote -v,确认指向 manaflow-ai/ghostty 的远程仓库名称。在 .gitmodules 中子模块 URL 已配置为该 fork 仓库,因此常规 checkout 下它通常是 origin;但旧配置可能会把 upstream 设为 origin 并将 fork 命名为 manaflow。请根据实际情况替换下方命令中的远程名称。

cd ghostty
git remote -v                  # 查找 manaflow-ai/ghostty 的 remote(通常为 origin)
git checkout -b <branch>
git add <files>
git commit -m "..."
git push origin <branch>

如需同步 upstream(ghostty-org/ghostty)的最新变更,由于默认 checkout 未包含该远程仓库,需先显式添加:

cd ghostty
git remote add upstream https://github.com/ghostty-org/ghostty.git   # 仅需添加一次
git fetch upstream
git checkout main
git merge upstream/main
git push origin main

随后在父仓库(主项目)中更新并记录新的 Commit SHA:

cd ..
git add ghostty
git commit -m "Update ghostty submodule"

子模块安全规范

对于任何子模块(包括 ghostty、vendor/bonsplithomebrew-cmux),在父仓库提交更新后的指针之前,必须先将子模块的 commit 推送到其对应的远程分支。切勿在游离头指针(detached HEAD)或临时分支上直接 commit,否则父仓库指向的 SHA 将无法从任何远程分支访问,导致后续 checkout 或 CI 构建抓取失败。

请使用刚推送的远程仓库,验证该 commit 是否已被指针拟跟踪的分支包含:

cd ghostty && git fetch origin main && git merge-base --is-ancestor HEAD origin/main

详细参考