Skip to content

fix: ensure installation commands are using .quiet - #5758

Merged
rekram1-node merged 10 commits into
anomalyco:devfrom
val-2:dev
Dec 22, 2025
Merged

rekram1-node merged 10 commits into
anomalyco:devfrom
val-2:dev

Conversation

@val-2

@val-2 val-2 commented Dec 18, 2025

Copy link
Copy Markdown
Contributor

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.

Comment on lines 74 to 87

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

woudlnt u need to do this for all these?

Hmmm and we use "$" elsewhere too would this affect everything?

Are we sure there isn't just a arg we need to send to $ to ensure it doesnt "take over" like it was?

Also did u see open bun discussions?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried all args and methods of Bun.$ and nothing worked.
I tested now also other commands for yarn, pnpm and bun and both yarn and pnpm triggered the same bug, even though they don't get executed on my system without manual modification of the code. I'm going to modify the pull request to include those as well.

For the other Bun.$ usages, I see that it quite used in the codebase but I'm not sure if all of those usages are affected. The other usages $ with npm, pnpm and yarn seem to be the ones affected so it might be necessary to add the wrapper there as well.

Potentially other commands might be affected but I haven't found them.

Which bun discussion are you referring to? I only saw the latest comment on #5489, but I don’t really have enough informations about Bun’s internals to tell whether it’s the same issue or not. This one seems specifically related to Bun.$, but I’m not sure if that’s the root cause or if there’s a better workaround.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that makes sense ig I was just asking if u saw a discussion on bun like if u know if anyoen else has seen this issue basically

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh got it, I’ve seen other issues about Bun not handling Ctrl+C correctly on Windows but in other conditions, nothing specifically related to Bun.$

@val-2

val-2 commented Dec 19, 2025

Copy link
Copy Markdown
Contributor Author

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)

@rekram1-node

Copy link
Copy Markdown
Collaborator

IT seems like the bug actually is in Bun

@rekram1-node

Copy link
Copy Markdown
Collaborator

@val-2 I think ik the better fix, see this:
c333ffa

All the "$" invocations were missing .quiet(..)

@rekram1-node

Copy link
Copy Markdown
Collaborator

I'm going to update this to use that and merge it, if that doesnt do the fix then we can explore this again

@rekram1-node rekram1-node changed the title Fix Ctrl+C handling on Windows fix: ensure installation commands are using .quiet Dec 22, 2025
@rekram1-node
rekram1-node merged commit 8bdc0c8 into anomalyco:dev Dec 22, 2025
2 checks passed
shuv1337 pushed a commit to shuv1337/shuvcode that referenced this pull request Dec 22, 2025
rekram1-node added a commit that referenced this pull request Dec 27, 2025
Rwanbt pushed a commit to Rwanbt/unifia that referenced this pull request May 5, 2026
AIALRA-0 pushed a commit to AIALRA-0/opencode-turn-engine that referenced this pull request Jun 10, 2026
Rwanbt pushed a commit to Rwanbt/unifia that referenced this pull request Jun 14, 2026
MarsQiu007 referenced this pull request in MarsQiu007/openNovel Jul 31, 2026
meSingh pushed a commit to meSingh/opencode that referenced this pull request Sep 6, 2026
androidand pushed a commit to androidand/opencode-skein that referenced this pull request Sep 19, 2026
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.

bug: ctrl+c exiting app even when prompt input isn't empty

2 participants