Fix Ctrl+C handling on Windows
Closes #5071
To fix the bug described in the issue, I introduced a small wrapper around Bun.spawn that kind of mimics the Bun.$ interface for the usage patterns (.text() and .throw(false)) related to the two problematic commands (npm list and npm config get registry).
I replaced the $ calls with this wrapper, and as a result the Ctrl+C handling now behaves correctly on Windows: it exits if no input prompt is present, otherwise it deletes the current input.
I placed the wrapper file in the same directory as the affected file to keep it close, since the bug currently impacts only that file. Additionally, the issue may be fixed upstream in Bun, in which case this wrapper would no longer be necessary.
I changed all occurrences of npm, pnpm and yarn to use spawnWrapper, excluding the ones that don't get used during OpenCode execution (for example as a standalone script like the publish script)
IT seems like the bug actually is in Bun
@val-2 I think ik the better fix, see this: https://github.com/sst/opencode/commit/c333ffa38bc6fffd6d2cc7b89f4990074a49a522
All the "$" invocations were missing .quiet(..)
I'm going to update this to use that and merge it, if that doesnt do the fix then we can explore this again