- **Activity monitor**: `procmon_open_window` creates or re-focuses the `procmon` window; `procmon_start` → `ProcSnapshot { session, rows, sampleMs, webkitUnavailable }`, `procmon_sample { session }`, `procmon_stop { session }`, `procmon_signal { pid, signal }` (TERM/KILL/INT/STOP/CONT only, and only for a pid inside one of OUR PTY subtrees — the webview must not be an arbitrary `kill(2)` gadget). Sampling is PULL-based: there is no sampler thread, the Activity window's own interval is the clock, and `stop` leaves the module holding nothing. `session` is a guard, not decoration: a mismatched id errors so a reloaded webview restarts cleanly instead of reading another window's deltas. Only ever called from the Activity window (`activity.html`), never the main one. `mod procmon` in `lib.rs` is a 3-way `#[cfg(target_os = …)]` split resolving to `procmon.rs` (macOS, libproc/mach FFI, `ri_phys_footprint` for memory), `procmon_linux.rs` (`/proc`, plain text, `VmRSS` for memory — no phys_footprint equivalent, no WebKit-sidecar attribution), or `procmon_other.rs` (every other OS: a stub reporting "unsupported"). All three share row shapes + OS-agnostic logic (subtree walk, `cpu_ratio`, `label_for`, `signal_from_name`) from `procmon_common.rs`. The macOS FFI genuinely fails to LINK if it ends up compiled into a non-macOS build — this split exists because that shipped broken once (the Linux release build failing at link time with undefined libproc/mach symbols).
0 commit comments