Repository navigation
Commit 2954703
feat(fetcher): add net_listening_ports for active LISTEN socket list
Per-directory value: after cd into a project, the splash answers "is my
dev server up?" and "what ports am I exposing right now?" without a
separate lsof | grep LISTEN. Cross-platform via netstat2 (procfs on Linux,
native syscall on macOS, GetExtendedTcpTable on Windows); PID -> process
name resolved through the existing sysinfo dep, scoped to only the PIDs
actually owning a socket so a host with thousands of processes doesn't
pay for an unrelated walk.
Cached (Safe), refresh 60s. 5 shapes: Entries (default — port -> process),
Text (count + leading-ports preview), TextBlock / MarkdownTextBlock (one
row per socket), Badge (count tier — >10 listening flips to Warn).
Options: protocol (tcp default since LISTEN is TCP-specific; udp and both
also accepted), family (v4 / v6 / both), exclude_loopback (drop 127.0.0.1
/ ::1 binds), limit (1..=50, default 10 — Badge always reports the
unclamped total).
The port label drops its protocol suffix when every row shares a
protocol, and reappears as 8080/tcp-style only when tcp and udp mix in
the result, so the default tcp-only view stays uncluttered.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>1 parent df5daed commit 2954703
2 files changed
Lines changed: 562 additions & 0 deletions
0 commit comments