Repository navigation
Description
Extension
Raycast Version
1.104.18
macOS Version
15.7.4 (24G517)
Description
The Open Ports in Menu Bar command can leave behind a high-CPU lsof process tree. On my machine, enabling the menu bar command quickly spawned multiple /usr/sbin/lsof +c0 -iTCP -w -sTCP:LISTEN -P -FpcRuLPn processes under Raycast Helper (Extensions), with each active lsof process consuming roughly one full CPU core.
I verified the relevant implementation at extensions/port-manager in commit 709e3df645ea4c5748584a5019e8b647510e70f9:
open-ports-menu-baris a menu bar command with"interval": "1m"Process.getCurrent()runs/usr/sbin/lsof +c0 -iTCP -w -sTCP:LISTEN -P -FpcRuLPnthroughchild_process.exec- I could not find an explicit timeout, child-process cleanup, or in-flight guard around this command
This does not look like a general lsof failure on the machine. Running the same command manually from Terminal completes consistently in about 0.30 seconds.
Environment details:
- Apple Silicon Mac
- macOS 15.7.4 (24G517)
- Raycast 1.104.18
- Apple
/usr/sbin/lsof4.91 - OrbStack running
- Network interfaces include multiple
utun,bridge, andvmenetinterfaces
Steps To Reproduce
-
Install and enable Port Manager.
-
Enable the
Open Ports in Menu Barcommand. -
Wait for background refreshes to run.
-
Check running
lsofprocesses:ps -o pid,ppid,pgid,stat,%cpu,%mem,etime,command -p $(pgrep -x lsof | tr '\n' ' ') -
Compare with running the same command manually:
/usr/bin/time -p /usr/sbin/lsof +c0 -iTCP -w -sTCP:LISTEN -P -FpcRuLPn >/tmp/port-manager-lsof.txt
Current Behaviour
When Open Ports in Menu Bar is enabled, Raycast spawns lsof processes under Raycast Helper (Extensions) that can hang or keep running at high CPU.
Observed examples:
Raycast
└─ Raycast Helper (Extensions)
├─ /usr/sbin/lsof +c0 -iTCP -w -sTCP:LISTEN -P -FpcRuLPn ~98-100% CPU
├─ /usr/sbin/lsof +c0 -iTCP -w -sTCP:LISTEN -P -FpcRuLPn ~98-100% CPU
└─ ...
During one controlled repro, the process count grew to 5 lsof processes within about 43 seconds, each using roughly 98-100% CPU. Load average climbed significantly.
After disabling Open Ports in Menu Bar, new scheduled launches appeared to stop, but already spawned lsof processes were not cleaned up. Some stale lsof processes remained attached to Raycast Helper (Extensions) and continued consuming CPU or spawning/replacing child lsof processes.
Example after the menu bar command was disabled:
Raycast
└─ Raycast Helper (Extensions) PID 14586
├─ lsof PID 29039 ~100% CPU
└─ lsof PID 20079 sleeping, long-lived
└─ lsof PID 31096 ~100% CPU
Manual baseline remains fast:
/usr/sbin/lsof +c0 -iTCP -w -sTCP:LISTEN -P -FpcRuLPn
real 0.30
user 0.20
sys 0.09
The only reliable cleanup was manually killing the affected process pattern:
pkill -9 -f 'lsof.*iTCP.*LISTEN'Expected Behaviour
The menu bar command should not accumulate or leak lsof processes.
Expected safeguards:
- only one
lsofrefresh should run at a time - a stuck
lsofchild process should be timed out and terminated - disabling the menu bar command should clean up any still-running child process tree
- background refreshes should not leave orphaned or long-lived high-CPU processes under
Raycast Helper (Extensions)
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Severity
Activity