Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(internal): Use Bun.stdin when using Bun to prevent process hanging #760

Conversation

annervisser
Copy link
Contributor

fix(internal): Use Bun.stdin when using Bun to prevent process hanging

Bun's node:process stdin implementation has multiple issues related to
raw mode, resuming, and ending it too early.

To work around this, this adds a custom branch for the read function
when running under Bun. It uses Bun's own stdin implementation to read
one chunk and then dispose the reader.

Fixes #759

Bun's node:process stdin implementation has multiple issues related to
raw mode, resuming, and ending it too early.

To work around this, this adds a custom branch for the read function
when running under Bun. It uses Bun's own stdin implementation to read
one chunk and then dispose the reader.

Fixes c4spar#759
Copy link
Owner

@c4spar c4spar left a comment

Choose a reason for hiding this comment

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

Thx @annervisser, LGTM!

@c4spar c4spar merged commit db5ae30 into c4spar:main Nov 5, 2024
12 checks passed
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.

keypress() never returns and blocks ctrl+C when running under Bun
2 participants