跳到正文
cccskills
免费在 GitHub 公开

cmux-debugging

Investigate cmux interface and runtime problems using debug logs, profiling, and the Debug menu. It guides changes to terminal rendering and tab lists, with checks for typing latency, SwiftUI state handling, and differences between macOS versions.

中文简介正在准备中。当前显示英语简介。

原文查看原文说明

Debug logging, Debug menu, runtime pitfalls, typing-latency-sensitive paths, SwiftUI list snapshot boundaries, OS-version repros, and local visual iteration for cmux. Use when adding debug probes, diagnosing UI/runtime issues, touching terminal rendering, tab/sidebar list views, drag/drop UTTypes, or using the Debug menu.

查看安装方法

适用场景

  • Investigating focus and tab switching problems
  • Checking typing latency after rendering changes
  • Tuning layout and colors through Debug windows
  • Reproducing bugs on the reporter's macOS version

包含的文件(4)

  • SKILL.md4.4 KB
  • agents/openai.yaml358 B
  • references/debug-event-log.md1.0 KB
  • references/runtime-pitfalls.md3.5 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

cmux Debugging

Debug event log

Put debug event instrumentation (keys, mouse, focus, splits, tabs) in the unified DEBUG build log. This is not a requirement to log every new code path; most probes belong to a dogfood debug loop and are removed before merge.

tail -f "$(cat /tmp/cmux-last-debug-log-path 2>/dev/null || echo /tmp/cmux-debug.log)"
  • Untagged Debug app logs to /tmp/cmux-debug.log; tagged (./scripts/reload.sh --tag <tag>) to /tmp/cmux-debug-<tag>.log.
  • reload.sh writes the current log path to /tmp/cmux-last-debug-log-path and the selected dev CLI path to /tmp/cmux-last-cli-path, and points /tmp/cmux-cli and $HOME/.local/bin/cmux-dev at that CLI.
  • Implementation: Packages/macOS/CMUXDebugLog/Sources/CMUXDebugLog/DebugEventLog.swift. App shim: Sources/App/DebugLogging.swift. Both are #if DEBUG, so every call site must be wrapped in #if DEBUG / #endif.
  • cmuxDebugLog("message") timestamps and appends in real time. A 500-entry ring buffer backs it; CMUXDebugLog.DebugEventLog.shared.dump() writes the full buffer to file.
  • Key events are logged in AppDelegate.swift (monitor, performKeyEquivalent); mouse/UI events inline in views (ContentView, BrowserPanelView).
  • Stable event prefixes: focus.panel, focus.bonsplit, focus.firstResponder, focus.moveFocus, tab.select, tab.close, tab.dragStart, tab.drop, pane.focus, pane.drop, divider.dragStart.

Profiling

Profile a tagged build by attaching to its pid (xctrace record --attach <pid>, sample <pid>). Never use xctrace --launch or Instruments' launch mode on any cmux bundle, and never quit, kill or relaunch the user's running cmux (com.cmuxterm.app): it holds their live agent sessions, and on 2026-09-26 a suspected profiler relaunch took five of them down.

Debug menu

DEBUG builds get a Debug menu in the macOS menu bar. When the user says "debug menu" or "debug window" they mean this, not defaults write.

Debug > Debug Windows holds panels for tuning layout, colors, and behavior, listed alphabetically with no dividers. To add one: create an NSWindowController subclass with a shared singleton, register it in the "Debug Windows" menu in Sources/cmuxApp.swift, and back it with a SwiftUI view using @AppStorage bindings for live changes.

Runtime pitfalls

  • Custom drag-and-drop UTTypes must be declared in Resources/Info.plist under UTExportedTypeDeclarations.
  • Do not add an app-level display link or manual ghostty_surface_draw loop; rely on Ghostty wakeups/renderer to avoid typing lag.
  • WindowTerminalHostView.hitTest() in Sources/TerminalWindowPortal.swift runs on every event including keyboard. Add no work outside the allowsPortalPointerHitTesting guard in performHitTest.
  • TabItemView in Sources/ContentView.swift uses Equatable plus .equatable() to skip body re-evaluation during typing. Do not add environment/store/binding reads without updating == and keeping .equatable() at the call site.
  • TerminalSurface.forceRefresh() in Packages/macOS/CmuxTerminal/Sources/CmuxTerminal/Surface/TerminalSurface+ForceRefresh.swift runs on every keystroke. No allocations, file I/O, or formatting.
  • SurfaceSearchOverlay must be mounted from GhosttySurfaceScrollView in Sources/GhosttyTerminalView.swift, not from SwiftUI panel containers.
  • Views below a LazyVStack / LazyHStack / List / ForEach boundary receive immutable snapshots plus closures, never an observable store.
  • Functions called from SwiftUI body must not mutate state or schedule store writes.
  • Foundation, SwiftUI, AttributeGraph, and WebKit semantics change between macOS majors. Test on the reporter's macOS before declaring a user repro disproven.

Detailed references

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

cmux

免费

Organize cmux windows, workspaces, and split panes so an agent can target the right terminal reliably. Create terminals with startup commands, move or reorder panels, change focus, and flash a panel to identify it.

中文简介正在准备中。当前显示英语简介。

  • Arrange terminals for several tasks
  • Start a development command in a new split
  • Move or reorder panels
manaflow-ai/cmux2.8万2026年10月19日 更新

Guide substantial Swift changes in cmux with rules for package boundaries, dependency direction, state management, concurrency, and API documentation. Structure code so public package types can be tested without launching the app.

中文简介正在准备中。当前显示英语简介。

  • Extracting a large app feature into Swift Packages
  • Reviewing dependencies between UI, domain models, and services
  • Restructuring state management and Swift 6 concurrency
manaflow-ai/cmux2.8万2026年10月19日 更新

Guide cmux backend changes with consistent rules for Effect, a TypeScript library for structured error handling. Covers Cloud VM state, database migrations, provider integrations, and authentication and payment checks so changes follow the intended architecture.

中文简介正在准备中。当前显示英语简介。

  • Implementing API error handling
  • Updating Cloud VM lifecycle logic
  • Preparing database migrations
manaflow-ai/cmux2.8万2026年10月19日 更新

Maintain cmux billing code with guidance on Stripe checkout, pricing, subscriptions, and access rights. It maps the relevant services and provides workflows for testing purchases, handling payment events, and rolling out billing changes.

中文简介正在准备中。当前显示英语简介。

  • Debugging checkout and subscription records
  • Updating prices and plan switching
  • Checking paid access and Cloud VM limits
manaflow-ai/cmux2.8万2026年10月19日 更新

Automate browsing in cmux panels without taking focus away from current work. Target a specific panel to open pages, fill forms, click controls, wait for page changes, extract content, and inspect download history.

中文简介正在准备中。当前显示英语简介。

  • Open and inspect sites without changing focus
  • Fill forms and check the result
  • Extract page text or HTML
manaflow-ai/cmux2.8万2026年10月19日 更新

Capture cmux windows as screenshots or video clips from the CLI. Create visual evidence for pull requests and bug reports, with region selection and captions to explain drags, animations, or layout changes.

中文简介正在准备中。当前显示英语简介。

  • Attaching screenshots of visual changes to a pull request
  • Recording drags and animations for a bug report
  • Capturing a specific window region with explanatory captions
manaflow-ai/cmux2.8万2026年10月19日 更新

查看 manaflow-ai 的全部技能

报告此技能的问题