remy / nodemon

Monitor for any changes in your node.js application and automatically restart the server - perfect for development
http://nodemon.io/
MIT License
26.11k stars 1.72k forks source link

bash node env vars for readline #2205

Open lokeb opened 1 month ago

lokeb commented 1 month ago

Nodemon does not respect NODE_NO_READLINE=1 env variable. I need to set this env variable as documented here: https://nodejs.org/api/repl.html#using-the-nodejs-repl-with-advanced-line-editors

Bash handles history and interrupts keyboard inputs like UP, DOWN, PGUP, PGDN. To use those keyboard inputs with Node, NODE_NO_READLINE=1 has to be set.

>$ NODE_NO_READLINE=1 node . //works
>$ NODE_NO_READLINE=1 nodemon . //does not work

In absence of this env var, keyboard inputs appear as escape sequences like [[^A, [[^B.

remy commented 1 month ago

I'm dropping directly into the repl - can you provide the script you're testing with?

Otherwise, when I run NODE_NO_READLINE=1 node (again, going directly into repl), and cursor up gives the same [[^A (on macos).

github-actions[bot] commented 3 weeks ago

This issue has been automatically marked as idle and stale because it hasn't had any recent activity. It will be automtically closed if no further activity occurs. If you think this is wrong, or the problem still persists, just pop a reply in the comments and @remy will (try!) to follow up. Thank you for contributing <3