7abe61a71f33d09df2c9253b8e4b77baf7c04b7c
- ContentView 观测 onChange(geo.size)/onAppear → controller.containerResized - containerResized: 点尺寸 × displayScale ÷ cell 像素 = 目标 cols×rows,去重 + debounce(200ms) → refresh-client -C WxH → tmux 重排回 %layout-change → 更新 pane frame - cell 像素来自 raw 终端/pane surface metrics(InMemoryTerminalViewport.cellWidthPixels); surface resize 回调只 noteCellPixels 不驱动 tmux(防反馈环,单向数据流) - 验证:容器 1032x1280@2x cell16x35→129x73,tmux 根 rect 精确采纳,2 pane 复用不重建 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
terminalX
原生苹果生态终端运维 / vibe coding 工具。平台优先级:iPadOS > iOS > macOS(Apple Silicon)。
核心选型:libghostty(终端引擎) · mosh · Tailscale (tsnet 用户态) · tmux control mode hook。
设计与决策见
docs/(若缺失,参见会话记忆 / 架构蓝图)。当前处于 M0(骨架 + 引擎 + libssh2 直连),走 SSH-first 路线。
仓库结构
packages/ 纯 Swift SPM 包(源码构建,依赖只向下)
TXCore 零依赖:模型 / 状态机 / 协议 / 纯算法(含 tmux control-mode 解析器)
TXTransport SSH(libssh2) 引导 · mosh 驱动 · UDP relay · 连接编排 [M1+]
TXTailnet tsnet 多节点 · DialerRouter · fd 桥 [M1+]
TXTerminal GhosttyKit 包装:Metal 渲染 · 键盘 · IME [M0]
TXSecurity Keychain / Secure Enclave / known_hosts [M4]
TXPTY 本地 PTY(仅 macOS) [M4]
TXUI SwiftUI 界面层 [M0+]
apps/ Xcode app targets(XcodeGen 生成,iOS/iPadOS 合一 + macOS 独立)
vendor/ 非 Swift 语言源(zig/go/c++),CI 产出 xcframework [M1+]
artifacts/ 预编译 xcframework 落地(gitignore)
开发
# M0:纯逻辑包,命令行即可测,无需 Xcode 工程
cd packages/TXCore && swift test
工具链要求
- Xcode 26+ / Swift 6.x(M0)
- Go + gomobile(M1,tsnet)
- CMake + Ninja + zig(M1/M2,vendor 构建)
Description
Languages
C
84.7%
Swift
14.9%
Objective-C
0.4%