Skip to content

Port the top fixes from upstream cmux#130

Merged
arzafran merged 5 commits into
mainfrom
feat/port-upstream-fixes
Jul 18, 2026
Merged

Port the top fixes from upstream cmux#130
arzafran merged 5 commits into
mainfrom
feat/port-upstream-fixes

Conversation

@arzafran

Copy link
Copy Markdown
Member

What this does

Brings over the five most valuable fixes upstream cmux has shipped since we forked in April. Typing under a title-spamming CLI (like a progress spinner or an agent) no longer lags, the app no longer risks a launch crash on macOS 26+, terminals no longer go blank after a completion notification, and tmux-format scripts finally see real session and window state instead of hardcoded fakes.

Summary

  • 78b3cdf — title updates coalesced per surface (50ms, last value always delivered) via GhosttyTitleUpdateDispatcher; logBackground file I/O moved to a serial background queue (BackgroundLogWriter). Ports of upstream c30733e / cb2129a.
  • ca60049 — SF Symbols sized only by .font(.system(size:)) can rasterize at 0×0 in a pre-visible layout pass, which macOS 26+ treats as a fatal NSInvalidArgumentException. New symbolRasterSize helper drives raster size from an explicit frame; 15 sites converted. Six matching sites inside TabItemView's equatable body were deliberately left alone (typing-latency guardrail). Port of upstream 5d79094.
  • ceb8480 — notification-ring-only state changes no longer force a terminal portal rebind (fixes terminal blanking until next tab switch, upstream 0bdf694); bonsplit DebugEventLog switched off deprecated ObjC-exception-throwing FileHandle APIs (upstream bonsplit cffd9a6).
  • 168b1d2 — tmux compat format context emits stable FNV-hashed session/window/pane ids and real active/focused state instead of $0 / always-active for every pane; the fake TMUX_PANE agents see now matches. Includes upstream's bundled fix for an opencode.json parse error leaking the home path. Port of upstream 4afeef6.

Deliberately not ported after investigation: upstream's divider-drag resize coalescing (a5a70ff) — it depends on a pixel-vs-cell sizing gate and bonsplit drag-end delegate hooks that don't exist in our architecture; porting it partially risks panes stuck at a stale size. Needs its own design if drag-resize perf ever becomes a complaint.

Test Plan

  • App builds clean (PROGRAMA_SKIP_ZIG_BUILD=1 local build, per-commit)
  • Go daemon: go build, go vet, go test (incl. new regression tests for the tmux identity fix), gofmt clean
  • Typing-latency guardrail paths (hitTest, forceRefresh, TabItemView) untouched — verified per commit
  • CI green

arzafran added 5 commits July 17, 2026 13:39
…off-thread

Port of upstream cmux c30733e (GhosttyTitleUpdateDispatcher: at most one
.ghosttyDidSetTitle post per surface per 50ms, last value always delivered)
and cb2129a (BackgroundLogWriter: single serial queue + long-lived
FileHandle instead of per-call open/seek/write/close under a lock).

Shells and agent CLIs that rewrite the title on every render no longer flood
the main actor during typing, and logBackground callers no longer block on
file I/O.
…S 26+ launch crash

Port of upstream cmux 5d79094/cb509ee745: Image(systemName:) sized only
via .font(.system(size:)) can rasterize at 0x0 during a window's pre-visible
layout pass, and macOS 26+ throws an uncaught NSInvalidArgumentException
(targetSizeInPoints must be > 0) instead of warning.

Adds RenderableSystemSymbol.clampedRasterPointSize + Image.symbolRasterSize
and converts 15 font-only-sized symbol sites. Six matching sites inside
TabItemView's equatable body are deliberately left alone (typing-latency
guardrail); same rendered size at every converted site.
…l; safe log FileHandle APIs

Two small upstream ports:

- cmux 0bdf694: a ring-only state change no longer forces a portal
  resynchronize in GhosttyTerminalView's update pass. Rebinding while SwiftUI
  is invalidating notification UI could leave the terminal hidden (blank)
  until the next tab switch.

- bonsplit cffd9a6: DebugEventLog now uses the throwing FileHandle APIs
  instead of the deprecated seekToEndOfFile/write/closeFile trio, which raise
  ObjC exceptions (uncatchable from Swift) if the log file disappears.
Port of upstream cmux 4afeef6. The tmux-compat format context emitted
hardcoded values for every pane and window: session_id was always $0,
window_active always 1, window_flags always *. Scripts and statuslines
parsing format strings across panes saw identical fake session ids and every
window claiming to be active.

Session/window/pane ids now derive from a stable FNV hash of the workspace
id, active/focused state is wired through from the real workspace list, and
selectors round-trip through the numeric ids. The fake TMUX_PANE an agent
sees now matches the format context. Also folds in the bundled fix that
stops an opencode.json parse error from leaking the user's home path.

Verified: go build, go vet, go test, gofmt all clean.
@arzafran
arzafran merged commit 71ae058 into main Jul 18, 2026
5 of 7 checks passed
@arzafran
arzafran deleted the feat/port-upstream-fixes branch July 18, 2026 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant