fix: Windows console popup issue using PowerShell workaround

Fixes blank console windows appearing on Windows 11 when spawning the worker process.

## Problem

On Windows, `windowsHide: true` doesn't work when combined with `detached: true` in child_process.spawn().
This is a Node.js limitation (nodejs/node#21825) that **Bun also inherits** because Bun uses Node.js process spawning semantics.

Result: Blank console windows with "claude" title appear during claude-mem operations.

## Solution

Use PowerShell's `Start-Process -WindowStyle Hidden` on Windows to properly hide console windows.
Unix platforms continue using standard `spawn()` with `detached: true`.

## Testing

Validated by ToxMox on Windows 11 in PR #315:
- windowsHide approach:  Still shows blank consoles
- PowerShell approach:  Properly hides windows

## Implementation

```typescript
// Windows: PowerShell workaround
Start-Process -FilePath 'bun' -ArgumentList '${script}' -WindowStyle Hidden

// Unix: Standard spawn (works fine)
spawn(bunPath, [script], { detached: true })
```

## Notes

- Affects BOTH Bun and Node.js runtimes on Windows
- This is a **high-priority fix** for Windows users
- Keeps Bun runtime (doesn't address zombie socket issue)
- Zombie socket issue is separate and requires different solution

## References

- Issue: #304 (Multiple visible console windows on Windows 11)
- Testing: PR #315 (ToxMox's detailed analysis)
- Node.js bug: nodejs/node#21825
- Extracted from: PR #335

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
Alex Newman
2025-12-15 23:13:21 -05:00
parent 2e919df2b4
commit 23591db589
10 changed files with 263 additions and 102 deletions

File diff suppressed because one or more lines are too long