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

readline not working #11194

Open
nodirbekrajaboff opened this issue May 20, 2024 · 0 comments
Open

readline not working #11194

nodirbekrajaboff opened this issue May 20, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@nodirbekrajaboff
Copy link

What version of Bun is running?

1.1.8+89d25807f

What platform is your computer?

Linux 5.4.0-169-generic x86_64 x86_64

What steps can reproduce the bug?

When I run the ts file with bunjs, readline doesn't work. If I run my ts file with bunjs, I can't type any characters in the terminal. But if I run it with "tsx" it works. These are my codes:
import readline from 'readline';

const rl = readline.createInterface({ input: process.stdin, output: process.stdout }); 

rl.question('What is your name? ', (answer) => { 
console.log(`Hello, ${answer}!`);
 rl.close(); 
}); 

This is what happened:
With tsx:

root@NL-200:/home/user/my-typescript-prompt-project/src# bunx tsx index.ts 
What is your name? Name 
Hello, Name! 

With bun:

root@NL-200:/home/user/my-typescript-prompt-project/src# bun index.ts 
What is your name?

No characters can be entered here

What is the expected behavior?

No response

What do you see instead?

No response

Additional information

I have a question. I have two VPS ubuntu servers. I ran this project with bunjs on my first VPS ubuntu server and it worked and I can easily type characters in the terminal. But on the second server (i.e. the problem I'm having now is on the second server) it doesn't work when I run this project (I couldn't write any characters in the terminal). WHY?

@nodirbekrajaboff nodirbekrajaboff added the bug Something isn't working label May 20, 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
Projects
None yet
Development

No branches or pull requests

1 participant