mirror of
https://github.com/affaan-m/everything-claude-code.git
synced 2026-02-15 10:53:18 +08:00
fix: eliminate child process spawns during session startup (#162)
getAvailablePackageManagers() spawned where.exe/which for each package manager (npm, pnpm, yarn, bun). During SessionStart hooks, these 4+ child processes combined with Bun's own initialization exceeded the spawn limit on Windows, freezing the terminal. Fix: Remove process spawning from the hot path. Steps 1-5 of detection (env var, project config, package.json, lock file, global config) already cover all file-based detection. If none match, default to npm without spawning. Also fix getSelectionPrompt() to list supported PMs without checking availability.
This commit is contained in:
@@ -66,8 +66,8 @@ async function main() {
|
||||
const pm = getPackageManager();
|
||||
log(`[SessionStart] Package manager: ${pm.name} (${pm.source})`);
|
||||
|
||||
// If package manager was detected via fallback, show selection prompt
|
||||
if (pm.source === 'fallback' || pm.source === 'default') {
|
||||
// If no explicit package manager config was found, show selection prompt
|
||||
if (pm.source === 'default') {
|
||||
log('[SessionStart] No package manager preference found.');
|
||||
log(getSelectionPrompt());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user