cmux/Sources
Lawrence Chen 9642bb59fc
Move port scanning from shell to app-side with batching (#100)
* Move port scanning from shell to app-side with batching

Replace per-shell `ps -axo + lsof` scanning with a centralized
PortScanner singleton in the app. Each shell now sends lightweight
`report_tty` (once per session) and `ports_kick` (on preexec/precmd)
socket messages. The app coalesces kicks across all panels and runs a
single `ps -t <ttys> + lsof -p <pids>` covering every active panel.

Also fixes a macOS 26 Tahoe regression where `getsockopt(LOCAL_PEERPID)`
returns ENOTCONN on accepted sockets when the peer disconnects before
the handler thread starts. This was silently breaking ALL socket
commands sent via ncat --send-only. The fix captures the peer PID in
the accept loop immediately after accept(), and falls back to
LOCAL_PEERCRED (uid check) when the PID lookup fails.

* Fix PR review feedback: burst timing and auth comment clarity

- P2: burstDelays were accumulating (0.5+1.5+3+... = ~22.5s) instead of
  firing at absolute offsets from burst start. Now uses burstStart anchor
  so scans fire at 0.5s, 1.5s, 3s, 5s, 7.5s, 10s as intended.

- P1: Clarify LOCAL_PEERCRED fallback rationale — same security boundary
  as socket file permissions (0600), does not widen attack surface.
  Long-lived connections still get full descendant check via LOCAL_PEERPID.
2026-02-19 01:04:47 -08:00
..
Find Fix terminal keys swallowed after opening browser (#45) 2026-02-17 03:21:08 -08:00
Panels Fix omnibar focus intent races for Cmd+L 2026-02-19 00:35:25 -08:00
Update Fix socket accept loop not restarted after Sparkle update relaunch 2026-02-17 22:00:47 -08:00
AppDelegate.swift Fix omnibar focus intent races for Cmd+L 2026-02-19 00:35:25 -08:00
Backport.swift Polish browser suggestions, focus, and tagged reload flow 2026-02-14 21:33:28 -08:00
cmuxApp.swift Socket access control: process ancestry check (#58) 2026-02-18 01:09:24 -08:00
ContentView.swift Merge pull request #83 from manaflow-ai/perf/portal-hosting-selected-mount 2026-02-18 22:31:45 -08:00
GhosttyConfig.swift Add cmuxterm CLI and socket control modes 2026-01-28 21:19:48 -08:00
GhosttyTerminalView.swift Speed up workspace switching: reduce portal churn and enforce selected z-order 2026-02-18 22:13:40 -08:00
KeyboardShortcutSettings.swift Fix terminal keys swallowed after opening browser (#45) 2026-02-17 03:21:08 -08:00
NotificationsPage.swift Fix frozen terminals after split churn (#12) 2026-02-13 16:45:31 -08:00
PortScanner.swift Move port scanning from shell to app-side with batching (#100) 2026-02-19 01:04:47 -08:00
PostHogAnalytics.swift Add sidebar metadata (git branch, ports, logs, progress), fix localhost URL resolution, simplify analytics 2026-02-16 02:46:39 -08:00
SidebarSelectionState.swift Fix frozen terminals after split churn (#12) 2026-02-13 16:45:31 -08:00
SocketControlSettings.swift Fix migrateMode dropping allowAll to default cmuxOnly 2026-02-18 02:12:19 -08:00
TabManager.swift Stabilize rapid workspace switching handoff 2026-02-18 21:17:53 -08:00
TerminalController.swift Move port scanning from shell to app-side with batching (#100) 2026-02-19 01:04:47 -08:00
TerminalNotificationStore.swift Polish browser suggestions, focus, and tagged reload flow 2026-02-14 21:33:28 -08:00
TerminalView.swift Add sidebar blur effect with withinWindow blending (#9) 2026-02-04 03:04:45 -08:00
TerminalWindowPortal.swift Speed up workspace switching: reduce portal churn and enforce selected z-order 2026-02-18 22:13:40 -08:00
UITestRecorder.swift Fix frozen terminals after split churn (#12) 2026-02-13 16:45:31 -08:00
WindowAccessor.swift Polish browser suggestions, focus, and tagged reload flow 2026-02-14 21:33:28 -08:00
WindowDecorationsController.swift Refine settings/about titlebar styling and controls alignment 2026-02-14 02:11:35 -08:00
WindowDragHandleView.swift Fix frozen terminals after split churn (#12) 2026-02-13 16:45:31 -08:00
WindowToolbarController.swift move update pill to sidebar only, add Install Update menu item 2026-02-15 21:17:33 -08:00
Workspace.swift Move port scanning from shell to app-side with batching (#100) 2026-02-19 01:04:47 -08:00
WorkspaceContentView.swift Speed up workspace switching: reduce portal churn and enforce selected z-order 2026-02-18 22:13:40 -08:00