-
Notifications
You must be signed in to change notification settings - Fork 0
Process Detection
The dashboard reads OS state directly. No internal "list of servers we started".
-
ps -A→ every process -
lsof -iTCP -sTCP:LISTEN→ listening sockets, grouped by PID -
lsof -p PID -d cwd→ cwd for each PID with a listener -
git rev-parse --git-common-dir --abbrev-ref HEAD→ group worktrees by shared git dir
Implementation in src/servers.ts::fetchServers. ~200–500ms per call.
The dashboard catches servers started in your terminal, via this extension, via any other tool. Anything listening counts. The source of truth is the OS, so we never go out of sync.
Earlier versions ran an embedded shell pipeline. The current code is ~3× faster and removes a class of shell-parsing bugs (awk/grep quoting, locale-dependent output, etc.).
Platform primitives are isolated in named functions: listProcesses, listListeners, listCwds, fetchAliases. Swap them for Windows equivalents and the aggregation logic stays unchanged.
Suggested mapping (untested):
| macOS | Windows |
|---|---|
ps -A |
Get-CimInstance Win32_Process |
lsof -iTCP -sTCP:LISTEN |
Get-NetTCPConnection -State Listen |
lsof -p PID -d cwd |
Win32_Process cwd via WMI |
portless list (via zsh) |
portless list (via PowerShell) |
killServer (SIGKILL + process.kill(pid, 0)) already maps cleanly to TerminateProcess/OpenProcess on Windows.
- Background refresh + a menu-bar command surfacing the running-server count. Would reuse
fetchServersdirectly. Requires ano-view/menu-barcommand and theintervalmanifest field.