mirror of
https://github.com/stablyai/orca.git
synced 2026-10-19 08:03:13 +00:00
The Checks panel polls window.api.pty.getCwd every 4s to follow the active terminal's cwd. It was gated only on panel visibility (isPanelVisible), not window visibility — so a hidden or minimized window kept spawning lsof on macOS every 4s (the 4s cadence exceeds getCwd's 1.5s per-pid cache TTL, so every tick is a guaranteed miss and a fresh subprocess). Swap the raw window.setInterval for installWindowVisibilityInterval — the shared helper every sibling timer already uses — which pauses while the window is hidden and runs an immediate refresh on becoming visible so a cd made while hidden is picked up on return. A visible-but-unfocused window (second monitor) keeps polling, matching prior behavior. Co-authored-by: Orca <help@stably.ai>