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

Windows: Bun raw mode behavior is different from Node #9853

Open
henrikvilhelmberglund opened this issue Apr 2, 2024 · 0 comments
Open

Windows: Bun raw mode behavior is different from Node #9853

henrikvilhelmberglund opened this issue Apr 2, 2024 · 0 comments
Labels
bug Something isn't working windows An issue that is known to occur on Windows

Comments

@henrikvilhelmberglund
Copy link

What version of Bun is running?

1.1.0+5903a6141

What platform is your computer?

Microsoft Windows NT 10.0.19045.0 x64

What steps can reproduce the bug?

Using Bun as a batch script runner instead of node. It seems like keys are not caught instantly, you need to press enter the first time, which creates a different behavior compared to Node.

import * as readline from "node:readline";
import { stdin as input, stdout as output } from "node:process";
readline.createInterface({ input, output });

process.stdin.setRawMode(true);

process.stdin.on("keypress", (str, key) => {
  console.log(str);
  console.log(key);
});

What is the expected behavior?

Expected: keys are logged instantly.

Node .gif:
node

What do you see instead?

Actual: keys are written to the screen and not logged instantly, after pressing enter raw mode works correctly.

Bun .gif:
bun

Additional information

No response

@henrikvilhelmberglund henrikvilhelmberglund added the bug Something isn't working label Apr 2, 2024
@henrikvilhelmberglund henrikvilhelmberglund changed the title Windows: Bun raw mode behavior is different from node Windows: Bun raw mode behavior is different from Node Apr 2, 2024
@gvilums gvilums added the windows An issue that is known to occur on Windows label Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working windows An issue that is known to occur on Windows
Projects
None yet
Development

No branches or pull requests

2 participants