Idle filter: suppress when watched process (claude) is running in distro

Probes wsl.exe -d <distro> -- pgrep -x claude before flagging a WSL pane
idle, with a 3s per-distro cache on the Rust side. If claude is running
anywhere in the distro, all panes in that distro stay out of the idle set
(per-pane granularity is out of scope — PIDs aren't observable from
Windows). PowerShell + SSH panes skip the probe and keep the legacy
always-notify behaviour.
This commit is contained in:
megaproxy 2026-05-26 17:24:46 +01:00
parent 5b970f8b48
commit f51033a142
7 changed files with 352 additions and 11 deletions

View file

@ -39,6 +39,14 @@ export interface SshHost {
export const listDistros = (): Promise<string[]> => invoke("list_distros");
/** Ask the backend whether any built-in "watched" process (currently just
* `claude`) is running in the given WSL distro. Cached per-distro for ~3s
* on the Rust side. Fail-safe: probe failures resolve to `true` so the
* caller suppresses the idle indicator. Only meaningful for WSL panes
* PowerShell + SSH should skip this and fall back to always-notify. */
export const isWatchProcessRunning = (distro: string): Promise<boolean> =>
invoke("is_watch_process_running", { distro });
export const spawnPane = (args: {
spec: SpawnSpec;
cols: number;