denoland / node_shims

npm packages providing shims for the Deno namespace and other globals. Useful for running Deno-first programs on Node.
MIT License
149 stars 29 forks source link

@deno/shim-prompts `prompt` doesn't end/exit on enter #158

Closed uncenter closed 11 months ago

uncenter commented 12 months ago

If you run this in Deno with deno run index.js, pressing enter ends the prompt:

prompt("> ");

But if you run this code with node index.js (assuming you have installed @deno/shim-prompts locally):

import { prompt } from "@deno/shim-prompts";

prompt("> ");

You get something different, where pressing enter just continues onto the next line and I can't seem to exit the prompt without exiting the program.

trgwii commented 12 months ago

Explanation and fix in #159. I tried finding what they changed in node to figure out which node versions are affected, but I was unable too, anyone who has time can make an attempt in nodejs/node commits and issues (binding.read / readSync)