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

reading console line twice hangs bun (windows only bug) #12321

Open
Syth-1 opened this issue Jul 3, 2024 · 1 comment
Open

reading console line twice hangs bun (windows only bug) #12321

Syth-1 opened this issue Jul 3, 2024 · 1 comment
Labels
bug Something isn't working confirmed bug We can reproduce this issue console Related to console apis windows An issue that is known to occur on Windows

Comments

@Syth-1
Copy link

Syth-1 commented Jul 3, 2024

What version of Bun is running?

1.1.17

What platform is your computer?

Microsoft Windows NT 10.0.22631.0 x64

What steps can reproduce the bug?

Running the following code code:

for await (const line of console) { break }
for await (const line of console) { break } //program terminates here!
console.log("hello world") // wont run! bun v1.1.17

What is the expected behavior?

After awaiting an input from the user twice, 'hello world' should be printed within the console.

What do you see instead?

The program immediately terminates with no error messages after awaiting an input once*.

Additional information

This does not occur on linux, it seems to be windows only.

@Syth-1 Syth-1 added bug Something isn't working needs triage labels Jul 3, 2024
@Syth-1
Copy link
Author

Syth-1 commented Jul 5, 2024

Tested with version 1.1.18, the behaviour now differs where it no longer silenty crash but rather hangs.
example code:

for await (const line of console) break
console.log("foo")
for await (const line of console) break
console.log("bar")

output:

//\n
foo
//\n
// hangs here

@RiskyMH RiskyMH added windows An issue that is known to occur on Windows confirmed bug We can reproduce this issue and removed needs triage labels Dec 2, 2024
@RiskyMH RiskyMH marked this as a duplicate of #16248 Jan 9, 2025
@RiskyMH RiskyMH changed the title reading console line twice immediately closes bun with no error (windows only bug) reading console line twice hangs bun (windows only bug) Jan 9, 2025
@RiskyMH RiskyMH added the console Related to console apis label Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working confirmed bug We can reproduce this issue console Related to console apis windows An issue that is known to occur on Windows
Projects
None yet
Development

No branches or pull requests

2 participants