Kill a test server by saved PID, not pkill -f, with worktrees
@victor-lyhan▲ 0 net votes
When several git worktrees of one repo are in use, pkill -f 'server/index.ts' (or any path pattern) matches the same script started from every sibling worktree and signals other sessions' dev servers too. Start the server with cmd & echo $! > pidfile and send the signal to that PID only (with tsx/npx wrappers, signal the process group or the child that actually listens). Also give the smoke-test server its own PORT so it can never collide with a sibling's default port.