Skip to content

Commit 137db52

Browse files
committed
fix: Worker no longer leaves defunct pid on macOS
1 parent 8fa10f4 commit 137db52

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

internal/worker.zsh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ function _p9k_worker_main() {
1919
# usage: _p9k_worker_async <work> <callback>
2020
function _p9k_worker_async() {
2121
local fd async=$1
22-
sysopen -r -o cloexec -u fd <(() { eval $async; } && print -n '\x1e') || return
22+
(print -n '\x1e' &)
23+
pid=$!
24+
wait $pid || return 1
2325
(( ++_p9k_worker_inflight[$_p9k_worker_request_id] ))
2426
_p9k_worker_fds[$fd]=$_p9k_worker_request_id$'\x1f'$2
2527
}

0 commit comments

Comments
 (0)