Skip to content

Conversation

@mynameistito
Copy link

Summary

This PR implements Shadow Copying for the bun-pty native binaries on Windows to resolve file-locking conflicts that cause the OpenCode Host to crash during multi-instance startup.

Changes

  • Created src/plugin/pty/shadow.ts to handle copying the rust_pty.dll to a temporary directory and setting process.env.BUN_PTY_LIB.
  • Refactored PTYManager in src/plugin/pty/manager.ts to lazy-load the bun-pty module only when needed, after ensuring the shadow copy is prepared.
  • Updated ptySpawn tool in src/plugin/pty/tools/spawn.ts to support the now-async manager.spawn method.

Impact

@mynameistito
Copy link
Author

mynameistito commented Jan 18, 2026

Please don't merge yet 😅

Edit: sweet it works as intended on Windows!

However maybe a little laggy if anyone else on Windows wants to check it out too that would be great :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Windows] Startup crash when opening multiple instances: EBUSY: failed copying files... package bun-pty

1 participant